refactor: remove redundant filtering in service (#25874)
* refactor: remove redundant filtering and return filtered users from service * Simplify user retrieval by returning users directly * Fix formatting issue in users.service.ts * Filter out null users in getDynamicEventType --------- Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
This commit is contained in:
co-authored by
Anik Dhabal Babu
parent
5bfbec6915
commit
6c620e37a6
@@ -28,14 +28,7 @@ export class UsersService {
|
|||||||
const users = await Promise.all(
|
const users = await Promise.all(
|
||||||
usernames.map((username) => this.usersRepository.findByUsername(username, orgSlug, orgId))
|
usernames.map((username) => this.usersRepository.findByUsername(username, orgSlug, orgId))
|
||||||
);
|
);
|
||||||
const usersFiltered: User[] = [];
|
|
||||||
|
|
||||||
for (const user of users) {
|
|
||||||
if (user) {
|
|
||||||
usersFiltered.push(user);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return users;
|
return users;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user