0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -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:
Daniel Lockyer 2021-06-28 12:16:45 +01:00
parent 58b3c47781
commit 1fc56ff1e8
No known key found for this signature in database
GPG key ID: D21186F0B47295AD

View file

@ -66,12 +66,14 @@ module.exports = {
'ref'
],
validation: {
source: {
required: true,
values: ['github']
},
ref: {
required: true
options: {
source: {
required: true,
values: ['github']
},
ref: {
required: true
}
}
},
permissions: {