Updated relationships to be nullable

ref #11 #13
This commit is contained in:
2020-12-02 19:45:02 +01:00
parent aa565c6b34
commit 4c80ab1516
17 changed files with 32 additions and 32 deletions

View File

@@ -55,7 +55,7 @@ export class GroupContact {
* Optional
*/
@IsOptional()
@ManyToOne(() => Address, address => address.participants)
@ManyToOne(() => Address, address => address.participants, { nullable: true })
address?: Address;
/**
@@ -79,12 +79,12 @@ export class GroupContact {
/**
* Used to link the contact as the donor of a donation.
*/
@OneToMany(() => Donation, donation => donation.donor)
@OneToMany(() => Donation, donation => donation.donor, { nullable: true })
donations: Donation[];
/**
* Used to link runners to donations.
*/
@OneToMany(() => RunnerGroup, group => group.contact)
@OneToMany(() => RunnerGroup, group => group.contact, { nullable: true })
groups: RunnerGroup[];
}