-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: create migration to change givbacks notification
- Loading branch information
Showing
2 changed files
with
80 additions
and
4 deletions.
There are no files selected for viewing
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
66 changes: 66 additions & 0 deletions
66
migrations/1721823068405-changeSeedNotificationTypeForGIVbackNotification.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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
import { NotificationType } from '../src/entities/notificationType'; | ||
|
||
export class changeSeedNotificationTypeForGIVbackNotification1721823068405 | ||
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.manager.update( | ||
NotificationType, | ||
{ name: 'GIVback is ready to claim' }, | ||
{ | ||
htmlTemplate: [ | ||
{ | ||
type: 'p', | ||
content: 'You have ', | ||
}, | ||
{ | ||
type: 'a', | ||
content: 'GIVbacks', | ||
href: '/givbacks', | ||
}, | ||
{ | ||
type: 'p', | ||
content: ' waiting to be claimed!', | ||
}, | ||
], | ||
content: 'You have GIVbacks waiting to be claimed!', | ||
}, | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.manager.update( | ||
NotificationType, | ||
{ name: 'GIVback is ready to claim' }, | ||
{ | ||
htmlTemplate: [ | ||
{ | ||
type: 'p', | ||
content: 'Your GIVback ', | ||
}, | ||
{ | ||
type: 'b', | ||
content: '$amount', | ||
}, | ||
{ | ||
type: 'p', | ||
content: ' GIV is ready to claim! ', | ||
}, | ||
{ type: 'br' }, | ||
{ | ||
type: 'a', | ||
content: 'Click here', | ||
href: '/givbacks', | ||
}, | ||
{ | ||
type: 'p', | ||
content: ' to take a shortcut.', | ||
}, | ||
], | ||
content: | ||
'Your GIVback {amount} GIV is ready to claim! \n[Click here] to take a shortcut.', | ||
}, | ||
); | ||
} | ||
} |