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