parent
335d4e24da
commit
2594a607dc
@ -29,7 +29,7 @@ export class CreateDonor extends CreateParticipant {
|
|||||||
newDonor.address = await this.getAddress();
|
newDonor.address = await this.getAddress();
|
||||||
newDonor.receiptNeeded = this.receiptNeeded;
|
newDonor.receiptNeeded = this.receiptNeeded;
|
||||||
|
|
||||||
if (this.receiptNeeded == true && this.email == "" && this.address == null) {
|
if (this.receiptNeeded == true && this.address == null) {
|
||||||
throw new DonorReceiptAddressNeededError()
|
throw new DonorReceiptAddressNeededError()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { IsBoolean, IsInt, IsOptional } from 'class-validator';
|
import { IsBoolean, IsInt, IsOptional } from 'class-validator';
|
||||||
|
import { DonorReceiptAddressNeededError } from '../../errors/DonorErrors';
|
||||||
import { Donor } from '../entities/Donor';
|
import { Donor } from '../entities/Donor';
|
||||||
import { CreateParticipant } from './CreateParticipant';
|
import { CreateParticipant } from './CreateParticipant';
|
||||||
|
|
||||||
@ -34,6 +35,10 @@ export class UpdateDonor extends CreateParticipant {
|
|||||||
donor.receiptNeeded = this.receiptNeeded;
|
donor.receiptNeeded = this.receiptNeeded;
|
||||||
donor.address = await this.getAddress();
|
donor.address = await this.getAddress();
|
||||||
|
|
||||||
|
if (this.receiptNeeded == true && this.address == null) {
|
||||||
|
throw new DonorReceiptAddressNeededError()
|
||||||
|
}
|
||||||
|
|
||||||
return donor;
|
return donor;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user