fix: user autocomplete emitter (#876)

This commit is contained in:
Max Peintner 2020-10-20 12:56:38 +02:00 committed by GitHub
parent f8616265be
commit 84b212bd75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,8 +118,12 @@ export class SearchUserAutocompleteComponent {
} else {
this.users = [this.filteredUsers[index]];
}
this.selectionChanged.emit(this.users);
if (this.singleOutput) {
this.selectionChanged.emit(this.users[0]);
} else {
this.selectionChanged.emit(this.users);
}
this.usernameInput.nativeElement.value = '';
this.myControl.setValue(null);
}
@ -140,7 +144,11 @@ export class SearchUserAutocompleteComponent {
public getGlobalUser(): void {
this.userService.GetUserByLoginNameGlobal(this.globalLoginNameControl.value).then(user => {
this.users = [user.toObject()];
this.selectionChanged.emit(this.users);
if (this.singleOutput) {
this.selectionChanged.emit(this.users[0]);
} else {
this.selectionChanged.emit(this.users);
}
}).catch(error => {
this.toast.showError(error);
});