Skip to content

Instantly share code, notes, and snippets.

@kutsaniuk
Created October 20, 2017 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kutsaniuk/bdeb282ef2cf9e55b3d7b8998e4961e0 to your computer and use it in GitHub Desktop.
Save kutsaniuk/bdeb282ef2cf9e55b3d7b8998e4961e0 to your computer and use it in GitHub Desktop.
(function () {
'use strict';
angular
.module('main')
.service('AboutService', function ($http,
$cookieStore,
$q,
$rootScope,
URL, BUCKET_SLUG, READ_KEY, WRITE_KEY, MEDIA_URL) {
$http.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
this.getPages = function (params) {
return $http.get(URL + BUCKET_SLUG + '/object-type/pages', {
params: {
limit: 100,
read_key: READ_KEY
}
});
};
this.updatePages = function (page) {
page.write_key = WRITE_KEY;
return $http.put(URL + BUCKET_SLUG + '/edit-object', page);
};
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment