-
Notifications
You must be signed in to change notification settings - Fork 925
feat: add notification preferences business logic & APIs #14117
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
feat: add notification preferences business logic & APIs #14117
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @dannykopping and the rest of your teammates on |
Meticulous was unable to execute a test run for this PR because the most recent commit is associated with multiple PRs. To execute a test run, please try pushing up a new commit that is only associated with this PR. Last updated for commit 11eacb8. This comment will update as new commits are pushed. |
4a0e0f2
to
8041cc7
Compare
6e027ef
to
01e7b50
Compare
30f3525
to
62f6dec
Compare
01e7b50
to
0aef037
Compare
88b9796
to
ce7f0c3
Compare
fe8aa2d
to
3516354
Compare
0386dab
to
8bec5b1
Compare
8bec5b1
to
f2926a3
Compare
3516354
to
2dd0b09
Compare
b3679fe
to
d627fef
Compare
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Test fix Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
2dd0b09
to
7bb1ee0
Compare
input := database.UpdateUserNotificationPreferencesParams{ | ||
UserID: user.ID, | ||
NotificationTemplateIds: make([]uuid.UUID, 0, len(prefs.TemplateDisabledMap)), | ||
Disableds: make([]bool, 0, len(prefs.TemplateDisabledMap)), |
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.
Suggest setting Enabled
in the external API instead.
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.
Yeah I vacillated on this quite a bit.
I think this is more correct though because the feature is to disable notifications, and this happens to line up with the database design as well.
33e9bc9
into
dk/notification-prefs/admin-template-method
Part of coder/internal#19
Users should be empowered to control which notifications they do not wish to receive.
Added two new routes:
GET /users/{users}/notifications/preferences
PUT /users/{users}/notifications/preferences
When a user has disabled a notification template in their preferences, we need to ensure that:
notifications.ErrCannotEnqueueDisabledNotification
errorThe database logic was implemented in #14100, see the
inhibit_enqueue_if_disabled
trigger.