From 00f42855e34c1edd41cb69a7b37113ab88e50f11 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Wed, 8 May 2024 10:39:18 +0200 Subject: [PATCH] Excluded `docName` key from API controller method map - due to the structure of our API controllers, the docName and methods are under the same structure - this code loops over the keys of the controller and forms the method map - however, it currently also loops over every character of the docName, so the resulting map contains a weird structure of chars - we don't need the docName for this, so we can just exclude it from the keys - this doesn't change any functionality --- ghost/api-framework/lib/pipeline.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/api-framework/lib/pipeline.js b/ghost/api-framework/lib/pipeline.js index a2dfa48440..79dc5b424a 100644 --- a/ghost/api-framework/lib/pipeline.js +++ b/ghost/api-framework/lib/pipeline.js @@ -186,7 +186,7 @@ const pipeline = (apiController, apiUtils, apiType) => { return controllerMap.get(apiController); } - const keys = Object.keys(apiController); + const keys = Object.keys(apiController).filter(key => key !== 'docName'); const docName = apiController.docName; // CASE: api controllers are objects with configuration.