mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 16:01:40 +03:00
30 lines
755 B
JavaScript
30 lines
755 B
JavaScript
|
module.exports = class CustomThemeSettingsBREADService {
|
||
|
/**
|
||
|
* @param {Object} options
|
||
|
* @param {Object} options.model - Bookshelf model for custom theme settings
|
||
|
*/
|
||
|
constructor({model}) {
|
||
|
this.Model = model;
|
||
|
}
|
||
|
|
||
|
async browse(data, options = {}) {
|
||
|
return this.Model.findAll(data, options);
|
||
|
}
|
||
|
|
||
|
async read(data, options = {}) {
|
||
|
return this.Model.findOne(data, options);
|
||
|
}
|
||
|
|
||
|
async edit(data, options = {}) {
|
||
|
return this.Model.edit(data, Object.assign({}, options, {method: 'update'}));
|
||
|
}
|
||
|
|
||
|
async add(data, options = {}) {
|
||
|
return this.Model.add(data, options);
|
||
|
}
|
||
|
|
||
|
async destroy(data, options = {}) {
|
||
|
return this.Model.destroy(data, options);
|
||
|
}
|
||
|
};
|