myems-admin/app/services/settings/store/storeworkingcalendar.service.js

Summary

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

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