myems-admin/app/services/settings/combinedequipment/combinedequipmentequipment.service.js

Summary

Maintainability
C
1 day
Test Coverage
'use strict';
app.factory('CombinedEquipmentEquipmentService', function($http) {
    return {
        addPair: function(combinedequipmentID,equipmentID, headers, callback) {
            $http.post(getAPI()+'combinedequipments/'+combinedequipmentID+'/equipments', {data:{'equipment_id':equipmentID}}, {headers})
            .then(function (response) {
                callback(response);
            }, function (response) {
                callback(response);
            });
        },

        deletePair: function(combinedequipmentID, equipmentID, headers, callback) {
            $http.delete(getAPI()+'combinedequipments/'+combinedequipmentID+'/equipments/'+equipmentID, {headers})
            .then(function (response) {
                callback(response);
            }, function (response) {
                callback(response);
            });
        },
        getEquipmentsByCombinedEquipmentID: function(id, headers, callback) {
            $http.get(getAPI()+'combinedequipments/'+id+'/equipments', {headers})
            .then(function (response) {
                callback(response);
            }, function (response) {
                callback(response);
            });
        }
    };
});