Initial COmmit WIP

This commit is contained in:
Julius Haertl
2016-06-05 15:07:47 +02:00
commit e10fe82afb
55 changed files with 6366 additions and 0 deletions

31
js/service/apiservice.js Normal file
View File

@@ -0,0 +1,31 @@
app.factory('ApiService', function($http){
var ApiService = function(http, BASEURL,endpoint) {
this.endpoint = endpoint;
this.baseUrl = OC.generateUrl('/apps/deck/' + endpoint);
this.http = http;
this.hashMap = {};
this.values = [];
};
ApiService.prototype.getAll = function(){
return $http.get(baseUrl);
}
ApiService.prototype.getOne = function (id) {
return $http.get(baseUrl + '/' + id);
};
ApiService.prototype.create = function (entity) {
return $http.post(baseUrl, entity);
};
ApiService.prototype.update = function (entity) {
return $http.put(baseUrl, entity)
};
ApiService.prototype.delete = function (id) {
return $http.delete(baseUrl + '/' + id);
};
return ApiService;
});