Ghost/core/server/api/canary/custom-theme-settings.js
Kevin Ansfield 59adb9a9cb Added route for updating custom theme settings
refs https://github.com/TryGhost/Team/issues/1070

- bumped `@tryghost/custom-theme-settings-service` for access to `.updateSettings()`
- added `PUT /custom_theme_settings` route that delegates to `customThemeSettingsService.updateSettings()` to perform the db and cache updates
- invalidates the cache in Ghost because a theme setting change will mean the front-end output will change
2021-09-28 16:09:39 +01:00

23 lines
523 B
JavaScript

const customThemeSettingsService = require('../../services/custom-theme-settings');
module.exports = {
docName: 'custom_theme_settings',
browse: {
permissions: true,
query() {
return customThemeSettingsService.listSettings();
}
},
edit: {
headers: {
cacheInvalidate: true
},
permissions: true,
query(frame) {
return customThemeSettingsService.updateSettings(frame.data.custom_theme_settings);
}
}
};