(function () { 'use strict'; angular.module('streamApp').service('timelineService', function (apiProxy, $location) { const baseUrl = 'api/timelines' this.add = function (name, description) { return apiProxy.POST({ url: baseUrl, data: { name, description } }).then(function (data) { return data.data; }); }; this.update = function (id, name, description) { return apiProxy.PUT({ url: baseUrl + '/' + id, data: { name, description } }).then(function (data) { return data.data; }); }; this.get = function (id) { return apiProxy.GET({ url: baseUrl + '/' + id, }).then(function (data) { return data.data; }); }; this.getInvitedNew = function (id) { return apiProxy.GET({ url: baseUrl + '/' + id + '/invited', }).then(function (data) { return data.data; }); }; this.getAll = function () { return apiProxy.GET({ url: baseUrl, }).then(function (data) { return data.data; }); }; this.getAllPrompts = function (id) { return apiProxy.GET({ url: baseUrl + `/${id}/prompts/all`, }).then(function (data) { return data.data; }); }; this.getAvailablePrompts = function (id) { return apiProxy.GET({ url: baseUrl + `/${id}/prompts`, }).then(function (data) { return data.data; }); }; this.addPrompts = function (id, ids) { return apiProxy.PUT({ url: baseUrl + '/' + id + '/prompts', data: { ids } }).then(function () { return; }); }; this.invite = function (id, ids) { return apiProxy.POST({ url: baseUrl + '/' + id + '/invite', data: { ids } }).then(function () { return; }); }; this.follow = function (id) { return apiProxy.POST({ url: baseUrl + '/' + id, }).then(function () { return; }); }; this.unfollow = function (id) { return apiProxy.DELETE({ url: baseUrl + '/' + id, }).then(function () { return; }); }; this.getTimelineForMoment = function (id) { return apiProxy.GET({ url: baseUrl + '/drops/' + id, }).then(function (data) { return data.data; }); }; this.addDropToTimeline = function (timelineId, dropId) { return apiProxy.POST({ url: baseUrl + '/drops/' + dropId + '/timelines/' + timelineId, }).then(function () { return; }); }; this.removeDropFromTimeline = function (timelineId, dropId) { return apiProxy.DELETE({ url: baseUrl + '/drops/' + dropId + '/timelines/' + timelineId, }).then(function () { return; }); }; }); })();