diff options
Diffstat (limited to 'client/src/app/shared/users')
-rw-r--r-- | client/src/app/shared/users/user.model.ts | 2 | ||||
-rw-r--r-- | client/src/app/shared/users/user.service.ts | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts index 7c840ffa7..9819829fd 100644 --- a/client/src/app/shared/users/user.model.ts +++ b/client/src/app/shared/users/user.model.ts | |||
@@ -15,6 +15,7 @@ export type UserConstructorHash = { | |||
15 | username: string, | 15 | username: string, |
16 | email: string, | 16 | email: string, |
17 | role: UserRole, | 17 | role: UserRole, |
18 | emailVerified?: boolean, | ||
18 | videoQuota?: number, | 19 | videoQuota?: number, |
19 | videoQuotaDaily?: number, | 20 | videoQuotaDaily?: number, |
20 | nsfwPolicy?: NSFWPolicyType, | 21 | nsfwPolicy?: NSFWPolicyType, |
@@ -31,6 +32,7 @@ export class User implements UserServerModel { | |||
31 | id: number | 32 | id: number |
32 | username: string | 33 | username: string |
33 | email: string | 34 | email: string |
35 | emailVerified: boolean | ||
34 | role: UserRole | 36 | role: UserRole |
35 | nsfwPolicy: NSFWPolicyType | 37 | nsfwPolicy: NSFWPolicyType |
36 | webTorrentEnabled: boolean | 38 | webTorrentEnabled: boolean |
diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/shared/users/user.service.ts index 27a81f0a2..cc5c051f1 100644 --- a/client/src/app/shared/users/user.service.ts +++ b/client/src/app/shared/users/user.service.ts | |||
@@ -153,6 +153,15 @@ export class UserService { | |||
153 | ) | 153 | ) |
154 | } | 154 | } |
155 | 155 | ||
156 | updateUsers (users: User[], userUpdate: UserUpdate) { | ||
157 | return from(users) | ||
158 | .pipe( | ||
159 | concatMap(u => this.authHttp.put(UserService.BASE_USERS_URL + u.id, userUpdate)), | ||
160 | toArray(), | ||
161 | catchError(err => this.restExtractor.handleError(err)) | ||
162 | ) | ||
163 | } | ||
164 | |||
156 | getUser (userId: number) { | 165 | getUser (userId: number) { |
157 | return this.authHttp.get<User>(UserService.BASE_USERS_URL + userId) | 166 | return this.authHttp.get<User>(UserService.BASE_USERS_URL + userId) |
158 | .pipe(catchError(err => this.restExtractor.handleError(err))) | 167 | .pipe(catchError(err => this.restExtractor.handleError(err))) |