parent
a9843ed459
commit
f8d7544517
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue