clean code
This commit is contained in:
parent
fa5bf118de
commit
b637993ba1
3 changed files with 5 additions and 9 deletions
|
|
@ -134,7 +134,7 @@ export class AddTaskComponent implements OnInit {
|
|||
searchTask(taskCreator: string): void {
|
||||
this.updateSearchInput();
|
||||
this.filteredUsers = this.firebaseService
|
||||
.getAllUserWithoutGuestCurrentUserAndCreator(taskCreator)
|
||||
.getFilteredUsers(taskCreator)
|
||||
.filter(
|
||||
(user) =>
|
||||
user.firstName.toLowerCase().includes(this.searchValue) ||
|
||||
|
|
|
|||
|
|
@ -60,9 +60,7 @@ export class AssignedComponent {
|
|||
if (this.searchInput) {
|
||||
return this.filteredUsers;
|
||||
} else {
|
||||
return this.firebaseService.getAllUserWithoutGuestCurrentUserAndCreator(
|
||||
this.taskCreator
|
||||
);
|
||||
return this.firebaseService.getFilteredUsers(this.taskCreator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,14 +113,12 @@ export class FirebaseService implements OnDestroy {
|
|||
return this.getAllUsers().filter((user) => user.initials !== 'G');
|
||||
}
|
||||
|
||||
getAllUserWithoutGuestCurrentUserAndCreator(taskCreator: string): User[] {
|
||||
getFilteredUsers(taskCreator: string): User[] {
|
||||
const currentUser = this.getCurrentUserId();
|
||||
const usersWithoutGuestAndCurrent = this.getAllUsers().filter(
|
||||
const filteredUsers = this.getAllUsers().filter(
|
||||
(user) => user.initials !== 'G' && user.id !== currentUser
|
||||
);
|
||||
return usersWithoutGuestAndCurrent.filter(
|
||||
(user) => user.id !== taskCreator
|
||||
);
|
||||
return filteredUsers.filter((user) => user.id !== taskCreator);
|
||||
}
|
||||
|
||||
getUserDataFromId(userId: string): User[] {
|
||||
|
|
|
|||
Loading…
Reference in a new issue