mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
🐛 Fixed validation on theme install API parameters
fixes https://github.com/TryGhost/Team/issues/818 - validation on query parameters should be wrapped in `options` within `validation` - this is missing from the theme install API endpoint so we don't force the parameters to be passed in - Ghost throws a 500 if `ref` is not supplied because following code assumes we've checked the existence - this commit wraps the two query parameter validation statements in an `options` object to ensure they exist - Ghost returns a 422 if missing
This commit is contained in:
parent
58b3c47781
commit
1fc56ff1e8
1 changed files with 8 additions and 6 deletions
|
@ -66,6 +66,7 @@ module.exports = {
|
||||||
'ref'
|
'ref'
|
||||||
],
|
],
|
||||||
validation: {
|
validation: {
|
||||||
|
options: {
|
||||||
source: {
|
source: {
|
||||||
required: true,
|
required: true,
|
||||||
values: ['github']
|
values: ['github']
|
||||||
|
@ -73,6 +74,7 @@ module.exports = {
|
||||||
ref: {
|
ref: {
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
permissions: {
|
permissions: {
|
||||||
method: 'add'
|
method: 'add'
|
||||||
|
|
Loading…
Add table
Reference in a new issue