Skip to content

Commit 027c74e

Browse files
authored
fix: add query schema and restore lastLogin behavior in users.getPresence
1 parent c0896b5 commit 027c74e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

apps/meteor/app/api/server/v1/users.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,17 @@ const usersEndpoints = API.v1
883883
'users.getPresence',
884884
{
885885
authRequired: true,
886+
query: ajv.compile<{
887+
userId?: string;
888+
username?: string;
889+
}>({
890+
type: 'object',
891+
properties: {
892+
userId: { type: 'string' },
893+
username: { type: 'string' },
894+
},
895+
additionalProperties: false,
896+
}),
886897
response: {
887898
400: validateBadRequestErrorResponse,
888899
401: validateUnauthorizedErrorResponse,
@@ -909,7 +920,7 @@ const usersEndpoints = API.v1
909920
return API.v1.success({
910921
presence: (user?.status || 'offline') as 'online' | 'offline' | 'away' | 'busy',
911922
connectionStatus: (user?.statusConnection || 'offline') as 'online' | 'offline' | 'away' | 'busy',
912-
...(user?.lastLogin && { lastLogin: user.lastLogin.toISOString() }),
923+
...(user?.lastLogin && { lastLogin: user.lastLogin }),
913924
});
914925
}
915926

0 commit comments

Comments
 (0)