tao-test/app/taoGroups/views/js/loader/taoGroups.min.js

2 lines
1.2 KiB
JavaScript

define("taoGroups/controller/routes",[],function(){'use strict';return{}}),define("taoGroups/provider/group",["jquery","lodash","i18n","util/url","core/promise","core/request"],function($,_,__,urlUtil,Promise,coreRequest){'use strict';return function(){return{addInstance:function addInstance(config){return config=_.defaults(config||{},{classUri:"http_2_www_0_tao_0_lu_1_Ontologies_1_TAOGroup_0_rdf_3_Group",id:"http://www.tao.lu/Ontologies/TAOGroup.rdf#Group",type:"instance"}),new Promise(function(resolve,reject){coreRequest({url:urlUtil.route("addInstance","Groups","taoGroups"),method:"POST",data:config,dataType:"json"}).then(function(group){resolve(group)}).catch(function(){reject(new Error(__("Unable to create new group")))})})},deleteGroup:function deleteGroup(uri){return new Promise(function(resolve,reject){return!_.isString(uri)||_.isEmpty(uri)?reject(new TypeError(__("Group uri is not valid"))):void coreRequest({url:urlUtil.route("delete","Groups","taoGroups"),method:"POST",data:{uri:uri},dataType:"json"}).then(function(response){resolve(response)}).catch(function(){reject(new Error(__("Unable to delete group")))})})}}}}),define("taoGroups/loader/taoGroups.bundle",function(){});
//# sourceMappingURL=taoGroups.min.js.map