mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 14:43:08 +03:00
Change response code of special settings API endpoints to 204
refs https://github.com/TryGhost/Toolbox/issues/308 - these endpoints return no body but they were implemented to return a 200 error code - 204 would be more suitable so this commit changes that for v5 - also removes the passthrough serializer and updates the snapshots to reflect the changes
This commit is contained in:
parent
ea3c927d94
commit
a48d8427f4
@ -96,6 +96,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
updateMembersEmail: {
|
||||
statusCode: 204,
|
||||
permissions: {
|
||||
method: 'edit'
|
||||
},
|
||||
@ -122,6 +123,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
disconnectStripeConnectIntegration: {
|
||||
statusCode: 204,
|
||||
permissions: {
|
||||
method: 'edit'
|
||||
},
|
||||
|
@ -86,7 +86,5 @@ module.exports = {
|
||||
download: serializeData,
|
||||
upload: serializeData,
|
||||
|
||||
updateMembersEmail: passthrough,
|
||||
validateMembersEmailUpdate: passthrough,
|
||||
disconnectStripeConnectIntegration: passthrough
|
||||
};
|
||||
|
@ -1127,10 +1127,8 @@ exports[`Settings API can do disconnectStripeConnectIntegration 1: [headers] 1`]
|
||||
Object {
|
||||
"access-control-allow-origin": "http://127.0.0.1:2369",
|
||||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "2",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
"vary": "Origin",
|
||||
"x-powered-by": "Express",
|
||||
}
|
||||
`;
|
||||
@ -1139,10 +1137,8 @@ exports[`Settings API can do updateMembersEmail 1: [headers] 1`] = `
|
||||
Object {
|
||||
"access-control-allow-origin": "http://127.0.0.1:2369",
|
||||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "2",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
"vary": "Origin",
|
||||
"x-powered-by": "Express",
|
||||
}
|
||||
`;
|
||||
|
@ -171,7 +171,7 @@ describe('Settings API', function () {
|
||||
email: 'test@test.com',
|
||||
type: 'fromAddressUpdate'
|
||||
})
|
||||
.expectStatus(200)
|
||||
.expectStatus(204)
|
||||
.expectEmptyBody()
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyEtag
|
||||
@ -206,7 +206,7 @@ describe('Settings API', function () {
|
||||
it('can do disconnectStripeConnectIntegration', async function () {
|
||||
await agent
|
||||
.delete('/settings/stripe/connect/')
|
||||
.expectStatus(200)
|
||||
.expectStatus(204)
|
||||
.expectEmptyBody()
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyEtag
|
||||
|
Loading…
Reference in New Issue
Block a user