Skip to content

Commit d02581d

Browse files
Fix default value of notification types
1 parent 161d201 commit d02581d

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

migrations/1660716115917-seedNotificationType.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,8 @@ export const GivethNotificationTypes = {
759759
title: 'GIVbacks',
760760
description: 'Notify me when my GIV from GIVbacks is ready to claim.',
761761
showOnSettingPage: true,
762+
categoryGroup: NOTIFICATION_CATEGORY_GROUPS.GIVBACKS,
763+
isGroupParent: true,
762764
emailDefaultValue: false,
763765
isEmailEditable: false,
764766
microService: MICRO_SERVICES.givEconomyNotificationMicroService,
@@ -1184,6 +1186,8 @@ export const GivethNotificationTypes = {
11841186
showOnSettingPage: true,
11851187
emailDefaultValue: false,
11861188
isEmailEditable: false,
1189+
isGroupParent: true,
1190+
categoryGroup: NOTIFICATION_CATEGORY_GROUPS.YOUR_PROJECT_UPDATE,
11871191
microService: MICRO_SERVICES.givethio,
11881192
category: NOTIFICATION_CATEGORY.PROJECT_RELATED,
11891193
icon: '',
@@ -1236,6 +1240,8 @@ export const GivethNotificationTypes = {
12361240
showOnSettingPage: true,
12371241
emailDefaultValue: false,
12381242
isEmailEditable: false,
1243+
categoryGroup: NOTIFICATION_CATEGORY_GROUPS.PROJECT_LIKES,
1244+
isGroupParent: true,
12391245
microService: MICRO_SERVICES.givethio,
12401246
category: NOTIFICATION_CATEGORY.PROJECT_RELATED,
12411247
icon: 'IconHeartFilled',
@@ -1267,12 +1273,13 @@ export const GivethNotificationTypes = {
12671273
showOnSettingPage: true,
12681274
emailDefaultValue: false,
12691275
isEmailEditable: false,
1276+
categoryGroup:
1277+
NOTIFICATION_CATEGORY_GROUPS.SUPPORTED_BY_YOU_PROJECT_HAS_NEW_UPDATE_GROUP,
1278+
isGroupParent: true,
12701279
microService: MICRO_SERVICES.givethio,
12711280
category: NOTIFICATION_CATEGORY.SUPPORTED_PROJECTS,
12721281
icon: '',
12731282
schemaValidator: SCHEMA_VALIDATORS_NAMES.PROJECT_UPDATED_ADDED_WHO_SUPPORTS,
1274-
categoryGroup:
1275-
NOTIFICATION_CATEGORY_GROUPS.SUPPORTED_BY_YOU_PROJECT_HAS_NEW_UPDATE_GROUP,
12761283
emailNotifierService: THIRD_PARTY_EMAIL_SERVICES.SEGMENT,
12771284
emailNotificationId: 'Project update added - Users who supported',
12781285
pushNotifierService: null,

src/entities/notificationSetting.ts

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export const NOTIFICATION_CATEGORY_GROUPS = {
2020
'supportedByYouProjectsStatusChange',
2121
SUPPORTED_BY_YOU_PROJECT_HAS_NEW_UPDATE_GROUP:
2222
'supportedByYouProjectsHasNewUpdate',
23+
YOUR_PROJECT_UPDATE: 'yourProjectUpdate',
24+
PROJECT_LIKES: 'projectLikes',
2325
PROJECT_STATUS: 'projectStatus',
2426
DONATIONS_MADE: 'donationsMade',
2527
DONATIONS_RECEIVED: 'donationsReceived',

src/repositories/notificationTypeRepository.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export const getNotificationTypeByEventName = async (eventName: string) => {
88

99
export const findNotificationTypeParent = async (categoryGroup: string) => {
1010
return NotificationType.createQueryBuilder()
11-
.where('category = :category', {
12-
category: categoryGroup,
11+
.where('"categoryGroup" = :categoryGroup', {
12+
categoryGroup,
1313
})
1414
.andWhere('"isGroupParent" = true')
1515
.getOne();

0 commit comments

Comments
 (0)