31.11. User Resolver - refactored pipe (#31)
This commit is contained in:
@ -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)!)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user