(function () { 'use strict'; var serviceId = 'foldersDataContext'; angular.module('folders').factory(serviceId, ['appDataContext', 'foldersConfig', 'config','itemsConfig', 'showcasesConfig', dataContext]); function dataContext(appDataContext, config, appConfig, $rootScope) { var service = {}; /** * Create a new folder */ service.createFolder = function (folder) { return appDataContext.post(config.folderRemoteServiceUrl, folder).then(function (data) { return data; }); } service.getFolder = function (folderId) { return appDataContext.get(config.folderRemoteServiceUrl + "?folderId=" + folderId).then(function (data) { return data; }); } service.getUserFolders = function () { return appDataContext.get(config.folderRemoteServiceUrl + "/all").then(function (data) { return data; }); } service.updateFolder = function (folder) { return appDataContext.put(config.folderRemoteServiceUrl, folder).then(function (data) { return data; }); } service.transferItem = function (item) { return appDataContext.put(config.folderRemoteServiceUrl + "/transferitem", {itemId : item.itemId, folderId: item.folderId}).then(function (data) { return data; }); } service.deleteFolder = function (item) { return appDataContext.delete(config.folderRemoteServiceUrl + item.itemId).then(function (data) { return data; }); } return service; } })();