Commit d58cebb9 authored by Venkaiah Naidu Singamchetty's avatar Venkaiah Naidu Singamchetty

Merge branch 'apiserver' into 'master'

'errorForGetActivityAdded'

See merge request !22
parents 3e3d72a5 0162e32c
...@@ -35,7 +35,10 @@ app.get("/employee/:id", (req, res) => { ...@@ -35,7 +35,10 @@ app.get("/employee/:id", (req, res) => {
db.collection("employees") db.collection("employees")
.findOne({ empId: Id }, { projection: { _id: false } }) .findOne({ empId: Id }, { projection: { _id: false } })
.then((result) => { .then((result) => {
res.send(result); if(!result)
res.status(404).json({ message: "Employee not found" });
else
res.send(result);
}) })
.catch((error) => res.status(401).send(error)); .catch((error) => res.status(401).send(error));
}); });
...@@ -109,7 +112,7 @@ app.post("/getreportees", (req, res) => { ...@@ -109,7 +112,7 @@ app.post("/getreportees", (req, res) => {
{ {
"empId":10000, "empId":10000,
"data":{ "data":{
"aName":"timesheet", "aName":"Approval of timesheet",
"aId":"D001", "aId":"D001",
"type":"default", "type":"default",
"score":3, "score":3,
......
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