31.11. User Resolver - refactored pipe (#31)

This commit is contained in:
Art
2021-10-10 11:45:03 +03:00
parent b9ef56302b
commit 9e9779e05e

View File

@ -97,8 +97,10 @@ export class UserService {
if (foundUser) return foundUser; if (foundUser) return foundUser;
return this.getAllUsers() return this.getAllUsers()
.pipe(map((page: UserPage, idx: number) => page.content)) .pipe(
.pipe(map(users => users.find(u => u.userId === id)!)); map((page: UserPage, idx: number) => page.content),
map(users => users.find(u => u.userId === id)!)
);
} }
} }