2014-05-12 20:08:19 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
angular.module('ffffng')
|
2017-05-06 18:40:59 +02:00
|
|
|
.service('NodeService', function ($http, config) {
|
|
|
|
var pathPrefix = config.rootPath === '/' ? '' : config.rootPath;
|
|
|
|
|
2014-05-12 20:08:19 +02:00
|
|
|
return {
|
|
|
|
'createNode': function (node) {
|
2017-05-06 18:40:59 +02:00
|
|
|
return $http.post(pathPrefix + '/api/node', node);
|
2014-05-12 20:08:19 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
'updateNode': function (node, token) {
|
2017-05-06 18:40:59 +02:00
|
|
|
return $http.put(pathPrefix + '/api/node/' + token, node);
|
2014-05-12 20:08:19 +02:00
|
|
|
},
|
|
|
|
|
2016-05-16 18:27:03 +02:00
|
|
|
'deleteNode': function (token) {
|
2017-05-06 18:40:59 +02:00
|
|
|
return $http.delete(pathPrefix + '/api/node/' + token);
|
2016-05-16 18:27:03 +02:00
|
|
|
},
|
|
|
|
|
2014-05-12 20:08:19 +02:00
|
|
|
'getNode': function (token) {
|
2017-05-06 18:40:59 +02:00
|
|
|
return $http.get(pathPrefix + '/api/node/' + token);
|
2014-05-12 20:08:19 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|