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 <[email protected]>
This commit is contained in:
Obaidullah IshfaqandAnik Dhabal Babu authored and GitHub committed 2026-01-21 15:12:54 -03:00
1 parent 5bfbec6915
commit 6c620e37a6
1 file changed
+1 -8
@@ -28,14 +28,7 @@ export class UsersService {
const users = await Promise.all(
usernames.map((username) => this.usersRepository.findByUsername(username, orgSlug, orgId))
);
const usersFiltered: User[] = [];
for (const user of users) {
if (user) {
usersFiltered.push(user);
}
}
return users;
}