@@ -1,5 +1,6 @@
|
||||
import { IsBoolean, IsOptional } from 'class-validator';
|
||||
import { DonorReceiptAddressNeededError } from '../../../errors/DonorErrors';
|
||||
import { Address } from '../../entities/Address';
|
||||
import { Donor } from '../../entities/Donor';
|
||||
import { CreateParticipant } from './CreateParticipant';
|
||||
|
||||
@@ -29,7 +30,7 @@ export class CreateDonor extends CreateParticipant {
|
||||
newDonor.receiptNeeded = this.receiptNeeded;
|
||||
newDonor.address = this.address;
|
||||
|
||||
if (this.receiptNeeded == true && this.address.isValidAddress == false) {
|
||||
if (this.receiptNeeded == true && Address.isValidAddress(newDonor.address) == false) {
|
||||
throw new DonorReceiptAddressNeededError()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user