Commit 87be001a authored by =sankoju Ravi's avatar =sankoju Ravi

getActivities changes

parent 4dda8c5c
...@@ -291,9 +291,14 @@ app.post("/getActivities", async(req, res) => { ...@@ -291,9 +291,14 @@ app.post("/getActivities", async(req, res) => {
.toArray() .toArray()
.then((result) => { .then((result) => {
if (result && result.length) { if (result && result.length) {
res.status(201).json({ ...result[0] }); let resData = { activities: [], totalCount: result[0].totalCount,"empId":empId };
result[0].data.forEach((item)=>{
resData["activities"].push(item.activities);
});
res.status(201).json(resData);
} else { } else {
res.status(201).json({ data: [], totalCount: { count: 0 } }); res.status(201).json({ activities: [], totalCount: { count: 0 } });
} }
}) })
.catch((error) => res.status(401).send(error)); .catch((error) => res.status(401).send(error));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment