Added relationships for donation

ref #11
This commit is contained in:
2020-12-01 19:13:56 +01:00
parent 1c43442300
commit 2b693917b0
2 changed files with 10 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
import { PrimaryGeneratedColumn, Column } from "typeorm";
import { PrimaryGeneratedColumn, Column, ManyToOne } from "typeorm";
import {
IsInt,
IsNotEmpty,
@@ -24,7 +24,7 @@ export abstract class Donation {
*/
@Column()
@IsNotEmpty()
//TODO: Relationship
@ManyToOne(() => Participant, donor => donor.donations)
donor: Participant;
/**