transforming response and getting the right object back for the line

This commit is contained in:
talksik
2022-05-05 08:56:40 -05:00
parent d013212054
commit 7f5eba7732
7 changed files with 116 additions and 38 deletions
+13
View File
@@ -19,6 +19,19 @@ export class UserService {
return null;
}
static async getUsersByIds(userIds: ObjectId[]) {
const query = { _id: { $in: userIds } };
const res = await collections.users?.find(query).toArray();
// exists
if (res?.length) {
return res as User[];
}
return undefined;
}
static async getUserByGoogleId(googleUserId: string) {
const query = { googleId: googleUserId };