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,
|
name: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
UserLog: {
|
||||||
|
orderBy: { createdAt: 'desc' },
|
||||||
|
take: 1,
|
||||||
|
select: { createdAt: true },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
orderBy: {
|
orderBy: {
|
||||||
[safeOrderBy]: safeOrderDir,
|
[safeOrderBy]: safeOrderDir,
|
||||||
@@ -1302,6 +1307,7 @@ const MonitoringServer = new Elysia({ prefix: "/api/monitoring" })
|
|||||||
idVillage: item.idVillage,
|
idVillage: item.idVillage,
|
||||||
idGroup: item.idGroup,
|
idGroup: item.idGroup,
|
||||||
idPosition: item.idPosition,
|
idPosition: item.idPosition,
|
||||||
|
lastActivity: item.UserLog[0]?.createdAt ?? null,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user