From 0842fad8f646d8bb71582ac1bc36ac220490355e Mon Sep 17 00:00:00 2001 From: Sebastian Webster Date: Tue, 10 Oct 2023 02:41:03 +1300 Subject: [PATCH] temp/getimagepostcomments now returns status code 200 when there are no comments --- controllers/Temp.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/controllers/Temp.js b/controllers/Temp.js index 00cdcc93..122289ba 100644 --- a/controllers/Temp.js +++ b/controllers/Temp.js @@ -1850,7 +1850,7 @@ class TempController { } if (postId.length == 0) { - return HTTPHandler.badInput(res, 'imageKey cannot be an empty string.') + return HTTPHandler.badInput(res, 'postId cannot be an empty string.') } function sendResponse(nameSendBackObject) { @@ -1864,9 +1864,8 @@ class TempController { if (data) { var nameSendBackObject = []; var comments = data.comments; - var itemsProcessed = 0; if (comments.length == 0) { - return resolve(HTTPWTHandler.notFound('No comments could not be found for image post')) + return resolve(HTTPWTHandler.OK('Comment search successful', [])) } else { const uniqueCommenters = Array.from(new Set(comments.map(comment => comment.commenterId)))