-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add opt-out option for email notifications in user settings (#163) #176
base: main
Are you sure you want to change the base?
Add opt-out option for email notifications in user settings (#163) #176
Conversation
@arafat4693 is attempting to deploy a commit to the Listinai Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @arafat4693, thank you so much!
Left you some comments :)
) { | ||
return this._organizationService.deleteTeamMember(org, id); | ||
} | ||
|
||
@Get('/email-notifications/:userId') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit dangerous because the userId can be faked. You should use the same technic in other routes
@GetUserFromRequest() user: User
return this._usersService.getEmailNotifications(userId); | ||
} | ||
|
||
@Post('/email-notifications/:userId') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here
const newSetting = !isChecked; | ||
setIsChecked(newSetting); | ||
|
||
await fetch(`/settings/email-notifications/${user.id}`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to pass the user.id, we have the authenticated user
@arafat4693 , are you still interested in this PR? |
This PR is done. Waiting for It to be merged |
feature
Fixes 🚀 Feature: Disable email notifications from settings #163
This PR introduces an opt-out option for email notifications in system settings. Users can now choose whether they want to receive transactional emails.