feat: tambah field lastActivity ke endpoint monitoring /user
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user