-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(prisma): Set default Donation Type to donation (#635)
There are recurring donations, created prior the implementation of the corporate flow, and thus resulting in an error when creating new donation, as type field is missing from the metadata. Set default value of DonationType to donation to prevent this
- Loading branch information
1 parent
8d4b6e7
commit 4d44d38
Showing
5 changed files
with
6 additions
and
16 deletions.
There are no files selected for viewing
8 changes: 1 addition & 7 deletions
8
apps/api/src/domain/generated/donation/dto/create-donation.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1 @@ | ||
import { DonationType } from '@prisma/client' | ||
import { ApiProperty } from '@nestjs/swagger' | ||
|
||
export class CreateDonationDto { | ||
@ApiProperty({ enum: DonationType }) | ||
type: DonationType | ||
} | ||
export class CreateDonationDto {} |
8 changes: 1 addition & 7 deletions
8
apps/api/src/domain/generated/donation/dto/update-donation.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1 @@ | ||
import { DonationType } from '@prisma/client' | ||
import { ApiProperty } from '@nestjs/swagger' | ||
|
||
export class UpdateDonationDto { | ||
@ApiProperty({ enum: DonationType }) | ||
type?: DonationType | ||
} | ||
export class UpdateDonationDto {} |
2 changes: 2 additions & 0 deletions
2
migrations/20240517165753_set_default_donation_type/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- AlterTable | ||
ALTER TABLE "donations" ALTER COLUMN "type" SET DEFAULT 'donation'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters