import { Component, OnInit } from '@angular/core'
import { Router } from '@angular/router'
-import { Notifier, ServerService } from '@app/core'
+import { AuthService, Notifier, ServerService } from '@app/core'
import { UserCreate, UserRole } from '../../../../../../shared'
import { UserEdit } from './user-edit'
import { I18n } from '@ngx-translate/i18n-polyfill'
protected serverService: ServerService,
protected formValidatorService: FormValidatorService,
protected configService: ConfigService,
+ protected auth: AuthService,
private userValidatorsService: UserValidatorsService,
private router: Router,
private notifier: Notifier,
password: this.userValidatorsService.USER_PASSWORD,
role: this.userValidatorsService.USER_ROLE,
videoQuota: this.userValidatorsService.USER_VIDEO_QUOTA,
- videoQuotaDaily: this.userValidatorsService.USER_VIDEO_QUOTA_DAILY
+ videoQuotaDaily: this.userValidatorsService.USER_VIDEO_QUOTA_DAILY,
+ byPassAutoBlacklist: null
}, defaultValues)
}
const userCreate: UserCreate = this.form.value
+ userCreate.adminFlags = this.buildAdminFlags(this.form.value)
+
// A select in HTML is always mapped as a string, we convert it to number
userCreate.videoQuota = parseInt(this.form.value['videoQuota'], 10)
+ userCreate.videoQuotaDaily = parseInt(this.form.value['videoQuotaDaily'], 10)
this.userService.addUser(userCreate).subscribe(
() => {