Skip to content

Commit

Permalink
feat: setting notification (#853)
Browse files Browse the repository at this point in the history
- setting notification for followers and upvotes
  • Loading branch information
rubenkristian authored Apr 19, 2023
1 parent ace7ec5 commit 7e5e86a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/models/notification-setting.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ export class NotificationSetting extends Entity {
})
tips?: boolean;

@property({
type: 'boolean',
default: true,
required: false,
})
followers?: boolean;

@property({
type: 'boolean',
default: true,
required: false,
})
upvotes?: boolean;

@belongsTo(() => User)
userId: string;

Expand Down
5 changes: 5 additions & 0 deletions src/services/notification.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,11 @@ export class NotificationService {
if (!notificationSetting.tips) return false;
break;

case NotificationType.POST_VOTE:
case NotificationType.COMMENT_VOTE:
if (!notificationSetting.upvotes) return false;
break;

default:
return false;
}
Expand Down

0 comments on commit 7e5e86a

Please sign in to comment.