Switch listUsers to searchUsers for adding project member (#18022)

Fixes #18000

Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
Shijun Sun 2022-12-23 16:09:22 +08:00 committed by GitHub
parent 76757a5334
commit d87d906c84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -225,7 +225,7 @@ export class AddGroupComponent implements OnInit, OnDestroy {
group_name: '', group_name: '',
}; };
this.isGroupNameValid = true; this.isGroupNameValid = true;
this.groupTooltip = 'MEMBER.USERNAME_IS_REQUIRED'; this.groupTooltip = 'MEMBER.GROUP_NAME_REQUIRED';
this.searchedGroups = []; this.searchedGroups = [];
} }
isValid(): boolean { isValid(): boolean {

View File

@ -17,7 +17,7 @@ describe('AddMemberComponent', () => {
}, },
}; };
const mockUserService = { const mockUserService = {
listUsers: () => { searchUsers: () => {
return of([[], []]); return of([[], []]);
}, },
}; };

View File

@ -81,10 +81,10 @@ export class AddMemberComponent implements OnInit, OnDestroy {
debounceTime(500), debounceTime(500),
switchMap(name => { switchMap(name => {
if (name) { if (name) {
return this.userService.listUsers({ return this.userService.searchUsers({
page: 1, page: 1,
pageSize: 10, pageSize: 10,
q: encodeURIComponent(`username=~${name}`), username: name,
}); });
} else { } else {
return of([]); return of([]);