diff options
Diffstat (limited to 'client/src/app/shared/users')
-rw-r--r-- | client/src/app/shared/users/user.service.ts | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/shared/users/user.service.ts index 249c589b7..fad5b0980 100644 --- a/client/src/app/shared/users/user.service.ts +++ b/client/src/app/shared/users/user.service.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | import { Observable } from 'rxjs' | ||
1 | import { catchError, map } from 'rxjs/operators' | 2 | import { catchError, map } from 'rxjs/operators' |
2 | import { HttpClient } from '@angular/common/http' | 3 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 4 | import { Injectable } from '@angular/core' |
4 | import { UserCreate, UserUpdateMe, UserVideoQuota } from '../../../../../shared' | 5 | import { UserCreate, UserUpdateMe, UserVideoQuota } from '../../../../../shared' |
5 | import { environment } from '../../../environments/environment' | 6 | import { environment } from '../../../environments/environment' |
@@ -117,4 +118,13 @@ export class UserService { | |||
117 | catchError(err => this.restExtractor.handleError(err)) | 118 | catchError(err => this.restExtractor.handleError(err)) |
118 | ) | 119 | ) |
119 | } | 120 | } |
121 | |||
122 | autocomplete (search: string): Observable<string[]> { | ||
123 | const url = UserService.BASE_USERS_URL + 'autocomplete' | ||
124 | const params = new HttpParams().append('search', search) | ||
125 | |||
126 | return this.authHttp | ||
127 | .get<string[]>(url, { params }) | ||
128 | .pipe(catchError(res => this.restExtractor.handleError(res))) | ||
129 | } | ||
120 | } | 130 | } |