Skip to content

Commit

Permalink
added response for getQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishektiwari47 committed Dec 1, 2023
1 parent 3f051e4 commit 70a9823
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apps/server/dist/routes/activities.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
Expand Down
7 changes: 6 additions & 1 deletion apps/server/routes/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand Down

0 comments on commit 70a9823

Please sign in to comment.