aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/users/user.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/users/user.service.ts')
-rw-r--r--client/src/app/shared/users/user.service.ts12
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 @@
1import { Observable } from 'rxjs'
1import { catchError, map } from 'rxjs/operators' 2import { catchError, map } from 'rxjs/operators'
2import { HttpClient } from '@angular/common/http' 3import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
4import { UserCreate, UserUpdateMe, UserVideoQuota } from '../../../../../shared' 5import { UserCreate, UserUpdateMe, UserVideoQuota } from '../../../../../shared'
5import { environment } from '../../../environments/environment' 6import { 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}