Marked param as optional (default: false)

ref #112
This commit is contained in:
Nicolai Ort 2021-01-21 19:08:43 +01:00
parent a9843ed459
commit f8d7544517
1 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import { IsBoolean, IsInt, IsNotEmpty, IsObject, IsOptional } from 'class-validator';
import { IsBoolean, IsInt, IsObject, IsOptional } from 'class-validator';
import * as uuid from 'uuid';
import { Address } from '../../entities/Address';
import { RunnerOrganisation } from '../../entities/RunnerOrganisation';
@ -26,9 +26,9 @@ export class UpdateRunnerOrganisation extends CreateRunnerGroup {
/**
* Is registration enabled for the updated organisation?
*/
@IsNotEmpty()
@IsOptional()
@IsBoolean()
registrationEnabled: boolean;
registrationEnabled?: boolean = false;
/**
* Updates a provided RunnerOrganisation entity based on this.
@ -41,7 +41,7 @@ export class UpdateRunnerOrganisation extends CreateRunnerGroup {
else { organisation.address = this.address; }
Address.validate(organisation.address);
if (this.registrationEnabled) {
if (this.registrationEnabled && !organisation.key) {
organisation.key = uuid.v4().toUpperCase();
}
else {