Skip to content

Commit b740aeb

Browse files
author
shawon-majid
committed
checking feature updated
1 parent 1c52859 commit b740aeb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/src/routes/logs.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import express from "express";
22
import { getAdminLogs, getContractorManagerLogs } from "../controllers/logs";
3-
import { adminLog } from "../services/logdata";
3+
import { adminLog, contractorLog } from "../services/logdata";
44
const router = express.Router();
55

66
router.route("/checkin").post((req, res) => {
77
const { flag } = req.body;
88

99
if (flag) {
1010
adminLog("Checkin", "Shawon Majid has checked in");
11+
contractorLog("Checkin", "Shawon Majid has checked in");
1112
} else {
13+
contractorLog("Checkin", "Shawon Majid has checked in");
1214
adminLog("Checkout", "Shawon Majid has checked out");
1315
}
16+
17+
res.status(200).json({ message: "Checkin status updated" });
1418
});
1519
router.route("/admin").get(getAdminLogs);
1620
router.route("/contractor").get(getContractorManagerLogs);

0 commit comments

Comments
 (0)