diff options
Diffstat (limited to 'shared')
-rw-r--r-- | shared/models/users/user-update.model.ts | 1 | ||||
-rw-r--r-- | shared/utils/users/users.ts | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/shared/models/users/user-update.model.ts b/shared/models/users/user-update.model.ts index abde51321..cd215bab3 100644 --- a/shared/models/users/user-update.model.ts +++ b/shared/models/users/user-update.model.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { UserRole } from './user-role' | 1 | import { UserRole } from './user-role' |
2 | 2 | ||
3 | export interface UserUpdate { | 3 | export interface UserUpdate { |
4 | password?: string | ||
4 | email?: string | 5 | email?: string |
5 | emailVerified?: boolean | 6 | emailVerified?: boolean |
6 | videoQuota?: number | 7 | videoQuota?: number |
diff --git a/shared/utils/users/users.ts b/shared/utils/users/users.ts index 61a7e3757..7191b263e 100644 --- a/shared/utils/users/users.ts +++ b/shared/utils/users/users.ts | |||
@@ -213,11 +213,13 @@ function updateUser (options: { | |||
213 | emailVerified?: boolean, | 213 | emailVerified?: boolean, |
214 | videoQuota?: number, | 214 | videoQuota?: number, |
215 | videoQuotaDaily?: number, | 215 | videoQuotaDaily?: number, |
216 | password?: string, | ||
216 | role?: UserRole | 217 | role?: UserRole |
217 | }) { | 218 | }) { |
218 | const path = '/api/v1/users/' + options.userId | 219 | const path = '/api/v1/users/' + options.userId |
219 | 220 | ||
220 | const toSend = {} | 221 | const toSend = {} |
222 | if (options.password !== undefined && options.password !== null) toSend['password'] = options.password | ||
221 | if (options.email !== undefined && options.email !== null) toSend['email'] = options.email | 223 | if (options.email !== undefined && options.email !== null) toSend['email'] = options.email |
222 | if (options.emailVerified !== undefined && options.emailVerified !== null) toSend['emailVerified'] = options.emailVerified | 224 | if (options.emailVerified !== undefined && options.emailVerified !== null) toSend['emailVerified'] = options.emailVerified |
223 | if (options.videoQuota !== undefined && options.videoQuota !== null) toSend['videoQuota'] = options.videoQuota | 225 | if (options.videoQuota !== undefined && options.videoQuota !== null) toSend['videoQuota'] = options.videoQuota |