mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Merge pull request #2661 from jgable/settingsPrimaryDocument
Settings API Primary Document refactor
This commit is contained in:
commit
21acce5391
1 changed files with 12 additions and 2 deletions
|
@ -1,10 +1,20 @@
|
||||||
/*global Ghost */
|
/*global Ghost, _ */
|
||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
//id:0 is used to issue PUT requests
|
//id:0 is used to issue PUT requests
|
||||||
Ghost.Models.Settings = Ghost.ProgressModel.extend({
|
Ghost.Models.Settings = Ghost.ProgressModel.extend({
|
||||||
url: Ghost.paths.apiRoot + '/settings/?type=blog,theme,app',
|
url: Ghost.paths.apiRoot + '/settings/?type=blog,theme,app',
|
||||||
id: '0'
|
id: '0',
|
||||||
|
|
||||||
|
parse: function (response) {
|
||||||
|
var result = _.reduce(response.settings, function (settings, setting) {
|
||||||
|
settings[setting.key] = setting.value;
|
||||||
|
|
||||||
|
return settings;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
Loading…
Add table
Reference in a new issue