aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/utils/users
diff options
context:
space:
mode:
Diffstat (limited to 'shared/utils/users')
-rw-r--r--shared/utils/users/user-notifications.ts3
-rw-r--r--shared/utils/users/users.ts2
2 files changed, 4 insertions, 1 deletions
diff --git a/shared/utils/users/user-notifications.ts b/shared/utils/users/user-notifications.ts
index bcbe29fc7..c8ed7df30 100644
--- a/shared/utils/users/user-notifications.ts
+++ b/shared/utils/users/user-notifications.ts
@@ -146,6 +146,7 @@ function checkVideo (video: any, videoName?: string, videoUUID?: string) {
146function checkActor (actor: any) { 146function checkActor (actor: any) {
147 expect(actor.displayName).to.be.a('string') 147 expect(actor.displayName).to.be.a('string')
148 expect(actor.displayName).to.not.be.empty 148 expect(actor.displayName).to.not.be.empty
149 expect(actor.host).to.not.be.undefined
149} 150}
150 151
151function checkComment (comment: any, commentId: number, threadId: number) { 152function checkComment (comment: any, commentId: number, threadId: number) {
@@ -273,8 +274,8 @@ async function checkNewActorFollow (
273 checkActor(notification.actorFollow.follower) 274 checkActor(notification.actorFollow.follower)
274 expect(notification.actorFollow.follower.displayName).to.equal(followerDisplayName) 275 expect(notification.actorFollow.follower.displayName).to.equal(followerDisplayName)
275 expect(notification.actorFollow.follower.name).to.equal(followerName) 276 expect(notification.actorFollow.follower.name).to.equal(followerName)
277 expect(notification.actorFollow.follower.host).to.not.be.undefined
276 278
277 checkActor(notification.actorFollow.following)
278 expect(notification.actorFollow.following.displayName).to.equal(followingDisplayName) 279 expect(notification.actorFollow.following.displayName).to.equal(followingDisplayName)
279 expect(notification.actorFollow.following.type).to.equal(followType) 280 expect(notification.actorFollow.following.type).to.equal(followType)
280 } else { 281 } else {
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