Fixed inconsistent error response from the API

- we have two JSON error response formats one old, one new (v2)
- we couldn't use the new one everywhere before without changing the response from older versions
- that is totally irrelevant in Ghost 5.0 as there is only one API version
- therefore we can and should use the new response format everywhere
- eventually we should rename it so it doesn't have v2 in it
This commit is contained in:
Hannah Wolfe 2022-05-02 13:31:25 +01:00
parent ab4ea4850d
commit c9ab21f821
No known key found for this signature in database
GPG Key ID: AB586C3B5AE5C037

View File

@ -33,7 +33,7 @@ module.exports = function setupApiApp() {
// Error handling for requests to non-existent API versions
apiApp.use(errorHandler.resourceNotFound);
apiApp.use(versionMissmatchHandler(APIVersionCompatibilityServiceInstance));
apiApp.use(errorHandler.handleJSONResponse(sentry));
apiApp.use(errorHandler.handleJSONResponseV2(sentry));
debug('Parent API setup end');
return apiApp;