add: checkRootDna

This commit is contained in:
Adisak 2026-01-28 17:46:07 +07:00
parent 83964e1198
commit 001a026e43
2 changed files with 34 additions and 2 deletions

View file

@ -50,7 +50,7 @@ async function logMiddleware(req: Request, res: Response, next: NextFunction) {
try {
rootId = token
? await new permission().checkOrg(token, req.app.locals.logData.userId)
? await new permission().checkRootDna(token, req.app.locals.logData.userId)
: null;
} catch (err) {
console.warn("Error fetching rootId:", err);
@ -59,7 +59,7 @@ async function logMiddleware(req: Request, res: Response, next: NextFunction) {
const obj = {
logType: res.statusCode >= 500 ? "error" : res.statusCode >= 400 ? "warning" : "info",
ip: req.ip,
rootId: rootId?.orgRootId ?? null,
rootId: rootId?.rootDnaId ?? null,
systemName: "salary",
startTimeStamp: timestamp,
endTimeStamp: new Date().toISOString(),