const body = this.form.value
const videoChannelCreate: VideoChannelCreate = {
displayName: body['display-name'],
- description: body.description,
- support: body.support
+ description: body.description || undefined,
+ support: body.support || undefined
}
this.videoChannelService.createVideoChannel(videoChannelCreate).subscribe(
}
getFormButtonTitle () {
- return 'Create this video channel'
+ return 'Create'
}
}
const body = this.form.value
const videoChannelUpdate: VideoChannelUpdate = {
displayName: body['display-name'],
- description: body.description,
- support: body.support
+ description: body.description || undefined,
+ support: body.support || undefined
}
this.videoChannelService.updateVideoChannel(this.videoChannelToUpdate.uuid, videoChannelUpdate).subscribe(
}
getFormButtonTitle () {
- return this.videoChannelToUpdate
- ? 'Update ' + this.videoChannelToUpdate.displayName + ' video channel'
- : 'Update'
+ return 'Update'
}
}
import { isAccountIdExist } from '../../helpers/custom-validators/accounts'
import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc'
import {
- isVideoChannelDescriptionValid, isVideoChannelExist,
- isVideoChannelNameValid, isVideoChannelSupportValid
+ isVideoChannelDescriptionValid,
+ isVideoChannelExist,
+ isVideoChannelNameValid,
+ isVideoChannelSupportValid
} from '../../helpers/custom-validators/video-channels'
import { logger } from '../../helpers/logger'
import { UserModel } from '../../models/account/user'
import { VideoChannelModel } from '../../models/video/video-channel'
import { areValidationErrors } from './utils'
-import { AccountModel } from '../../models/account/account'
const listVideoAccountChannelsValidator = [
param('accountId').custom(isIdOrUUIDValid).withMessage('Should have a valid account id'),