Added the customThemes limits to all api versions

https://github.com/TryGhost/Team/issues/663
This commit is contained in:
Thibaut Patel 2021-05-21 09:55:52 +02:00
parent 9010932466
commit 55a0c69451
2 changed files with 16 additions and 4 deletions

View File

@ -28,8 +28,13 @@ module.exports = {
}
},
permissions: true,
query(frame) {
async query(frame) {
let themeName = frame.options.name;
if (limitService.isLimited('customThemes')) {
await limitService.errorIfWouldGoOverLimit('customThemes', {value: themeName});
}
const newSettings = [{
key: 'active_theme',
value: themeName
@ -54,7 +59,8 @@ module.exports = {
},
async query(frame) {
if (limitService.isLimited('customThemes')) {
await limitService.errorIfWouldGoOverLimit('customThemes');
// Sending a bad string to make sure it fails (empty string isn't valid)
await limitService.errorIfWouldGoOverLimit('customThemes', {value: '.'});
}
// @NOTE: consistent filename uploads

View File

@ -28,8 +28,13 @@ module.exports = {
}
},
permissions: true,
query(frame) {
async query(frame) {
let themeName = frame.options.name;
if (limitService.isLimited('customThemes')) {
await limitService.errorIfWouldGoOverLimit('customThemes', {value: themeName});
}
const newSettings = [{
key: 'active_theme',
value: themeName
@ -54,7 +59,8 @@ module.exports = {
},
async query(frame) {
if (limitService.isLimited('customThemes')) {
await limitService.errorIfWouldGoOverLimit('customThemes');
// Sending a bad string to make sure it fails (empty string isn't valid)
await limitService.errorIfWouldGoOverLimit('customThemes', {value: '.'});
}
// @NOTE: consistent filename uploads