From cf2841e5115f398506cf5146dd60e999f32b774d Mon Sep 17 00:00:00 2001 From: agricreations Date: Fri, 26 Apr 2024 19:30:10 +0530 Subject: [PATCH] updating backend controller for compoentns to with static likes and comments --- backend/controller/components.controller.js | 28 ++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/backend/controller/components.controller.js b/backend/controller/components.controller.js index 67ae5e2..e4ed00e 100644 --- a/backend/controller/components.controller.js +++ b/backend/controller/components.controller.js @@ -33,12 +33,38 @@ function readFilesInformations(catogriesName, folderName,{data, user}, callback) if (jsErr) { return callback(jsErr); } - + // #TODO handle this likes and saved with the real data const dataObject = { "post_details": { "html": htmlContent, "css": cssContent, "js": jsContent, + "type" : "components", + "like": { + "isLiked": true, + "likeCount": "100" + }, + "saved":{ + "isSaved": true, + "savedCount": "100" + }, + "comments":{ + "count": "10", + "commentsList": [ + { + "comment":"testing comments", + "user": "Moovendhan", + "avatar": "testing", + "date": "testing" + }, + { + "comment":"testing comments two", + "user": "Agricreations", + "avatar": "testing", + "date": "testing" + } + ] + }, "folder_path": data.folder_path, "folder_name": data.folder_name, "catogries": data.categories,