+ if (autoPlayVideo !== undefined && autoPlayVideo !== null) toSend['autoPlayVideo'] = autoPlayVideo
+ if (email !== undefined && email !== null) toSend['email'] = email
+
+ return request(url)
+ .put(path)
+ .set('Accept', 'application/json')
+ .set('Authorization', 'Bearer ' + accessToken)
+ .send(toSend)
+ .expect(204)
+}
+
+function updateUser (url: string, userId: number, accessToken: string, email: string, videoQuota: number, role: UserRole) {
+ const path = '/api/v1/users/' + userId
+
+ const toSend = {}
+ if (email !== undefined && email !== null) toSend['email'] = email
+ if (videoQuota !== undefined && videoQuota !== null) toSend['videoQuota'] = videoQuota
+ if (role !== undefined && role !== null) toSend['role'] = role