From 3e13918e5757396fc517f575e4a61cd31d776526 Mon Sep 17 00:00:00 2001 From: Sam Lord Date: Thu, 10 Nov 2022 16:38:30 +0000 Subject: [PATCH] Made content import API return semantic HTTP codes no issue --- ghost/core/core/server/api/endpoints/db.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ghost/core/core/server/api/endpoints/db.js b/ghost/core/core/server/api/endpoints/db.js index 2d3f60111d..f874104c89 100644 --- a/ghost/core/core/server/api/endpoints/db.js +++ b/ghost/core/core/server/api/endpoints/db.js @@ -70,19 +70,16 @@ module.exports = { }, importContent: { + statusCode(result) { + if (result && (result.data || result.images)) { + return 201; + } else { + return 202; + } + }, headers: { cacheInvalidate: true }, - options: [ - 'include' - ], - validation: { - options: { - include: { - values: exporter.BACKUP_TABLES - } - } - }, permissions: true, query(frame) { const siteTimezone = settingsCache.get('timezone');