From 70a98238177b020039851af6ea1bf2ab92932844 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Fri, 1 Dec 2023 19:08:27 +0530 Subject: [PATCH] added response for getQuery --- apps/server/dist/routes/activities.js | 5 ++++- apps/server/routes/activities.ts | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/server/dist/routes/activities.js b/apps/server/dist/routes/activities.js index d8eb656..6724bad 100644 --- a/apps/server/dist/routes/activities.js +++ b/apps/server/dist/routes/activities.js @@ -243,7 +243,10 @@ router.get('/getQuery', index_1.authenticateJwt, (req, res) => __awaiter(void 0, const query = yield db_1.Query.find({ userId: userId }); console.log(query); if (query) { - res.json(query); + res.json({ + "userId": userId, + "query": query + }); } else { res.json({ "mes": "not found babe" }); diff --git a/apps/server/routes/activities.ts b/apps/server/routes/activities.ts index 47e0340..ad2d89c 100644 --- a/apps/server/routes/activities.ts +++ b/apps/server/routes/activities.ts @@ -293,11 +293,16 @@ router.post('/acceptABid/:productId',authenticateJwt,async (req,res)=>{ router.get('/getQuery',authenticateJwt,async (req,res)=>{ const userId = req.headers["userId"]; + + const query = await Query.find({userId:userId}) console.log(query); if(query) { - res.json(query) + res.json({ + "userId":userId, + "query":query + }) } else{ res.json({"mes":"not found babe"})