API: Fix notify by email endpoint names and params#4617
Merged
Conversation
Collaborator
Author
|
@cursor review |
Collaborator
Author
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit b07d403. Configure here.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Current endpoint fields used to create
notify_by_emailrecords made same implementation on SaaS one harder. So, fields already defined by SaaS,notify_emails_toandnotify_emails_to_locale, are defined to be used.Related Issue
#4167
Type of Change
Note: Technically these changes may brake some API requests. But, this feature is introduced a few days ago, so any requests sent to create
notify_by_emailshouldn't be broken.Checklist
rake test)Note
Medium Risk
Breaking v2 API and route names for a new feature; behavior depends on after_validation mapping to legacy internal fields—regression risk if mapping or required-flag handling is wrong on create vs post-create notify.
Overview
Breaking API and form rename for email notifications: clients and UI now use flat
notify_emails_toandnotify_emails_to_localeinstead of nestednotify_by_email/notify_by_email_recipientsfields. The member action and routenotify_by_emailbecomenotify_emails(web andPOST /api/v2/pushes/:token/notify_emails).Controllers stop manually copying recipient params; they permit the new attributes on create and call shared
Pwpush::AssignNotifiableByEmailFieldsto setnotify_by_email_creatorandnotify_emails_to_required.Pwpush::NotifiableByEmailvalidates the public fields, maps them to internalnotify_by_email_recipients/notify_by_email_localeafter validation (soAuditLog/NotifyByEmail/SendNotifyByEmailJobstay the same), and returns field-level errors instead of mostly:basemessages.Create responses expose
notify_emails_toat the top level in JSON (no nestednotify_by_emailobject). Docs, partials, and tests are updated throughout; push update no longer accepts notify fields viaupdate_params(unchanged behavior, explicit test removed).Reviewed by Cursor Bugbot for commit 7a4c6d0. Bugbot is set up for automated code reviews on this repo. Configure here.