feat: tambah field lastActivity ke endpoint monitoring /user

This commit is contained in:
2026-05-28 14:09:42 +08:00
parent 3b5126d8ee
commit 3272ecaef3

View File

@@ -1274,6 +1274,11 @@ const MonitoringServer = new Elysia({ prefix: "/api/monitoring" })
name: true,
},
},
UserLog: {
orderBy: { createdAt: 'desc' },
take: 1,
select: { createdAt: true },
},
},
orderBy: {
[safeOrderBy]: safeOrderDir,
@@ -1302,6 +1307,7 @@ const MonitoringServer = new Elysia({ prefix: "/api/monitoring" })
idVillage: item.idVillage,
idGroup: item.idGroup,
idPosition: item.idPosition,
lastActivity: item.UserLog[0]?.createdAt ?? null,
}));
return {