myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js

Summary

Maintainability
C
1 day
Test Coverage
'use strict';
app.factory('SpaceEnergyFlowDiagramService', function($http) {
    return {
        addPair: function(spaceID,energyflowdiagramID, headers, callback) {
            $http.post(getAPI()+'spaces/'+spaceID+'/energyflowdiagrams',{data:{'energy_flow_diagram_id':energyflowdiagramID}}, {headers})
            .then(function (response) {
                callback(response);
            }, function (response) {
                callback(response);
            });
        },

        deletePair: function(spaceID, energyflowdiagramID, headers, callback) {
            $http.delete(getAPI()+'spaces/'+spaceID+'/energyflowdiagrams/'+energyflowdiagramID, {headers})
            .then(function (response) {
                callback(response);
            }, function (response) {
                callback(response);
            });
        },
        getEnergyFlowDiagramsBySpaceID: function(id, headers, callback) {
            $http.get(getAPI()+'spaces/'+id+'/energyflowdiagrams', {headers})
            .then(function (response) {
                callback(response);
            }, function (response) {
                callback(response);
            });
        }
    };
});