fix(donations): Fixed creation bug
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { IsInt, IsPositive } from 'class-validator';
|
||||
import { IsInt, IsOptional, IsPositive } from 'class-validator';
|
||||
import { getConnection } from 'typeorm';
|
||||
import { RunnerNotFoundError } from '../../../errors/RunnerErrors';
|
||||
import { DistanceDonation } from '../../entities/DistanceDonation';
|
||||
@@ -22,6 +22,7 @@ export class CreateDistanceDonation extends CreateDonation {
|
||||
* The donation's paid amount in the smalles unit of your currency (default: euro cent).
|
||||
*/
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
paidAmount?: number;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Exclude } from 'class-transformer';
|
||||
import { IsInt, IsOptional } from 'class-validator';
|
||||
import { getConnection } from 'typeorm';
|
||||
import { Donation } from '../../entities/Donation';
|
||||
import { Donor } from '../../entities/Donor';
|
||||
@@ -7,10 +7,12 @@ import { Donor } from '../../entities/Donor';
|
||||
* This class is used to create a new Donation entity from a json body (post request).
|
||||
*/
|
||||
export abstract class CreateDonation {
|
||||
@Exclude()
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
donor: number;
|
||||
|
||||
@Exclude()
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
paidAmount?: number;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user