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

Summary

Maintainability
C
1 day
Test Coverage
'use strict';
app.factory('SpaceWorkingCalendarService', function($http) {
    return {
        addPair: function(spaceID, workingcalendarID, headers, callback) {
            $http.post(getAPI()+'spaces/'+spaceID+'/workingcalendars', {data: {"working_calendar_id": workingcalendarID}}, {headers})
            .then(function (response) {
                callback(response);
            }, function (response) {
                callback(response);
            });
        },

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