-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fix(db-postgres): ensure deletion of numbers and texts in upsertRow #11787
base: main
Are you sure you want to change the base?
fix(db-postgres): ensure deletion of numbers and texts in upsertRow #11787
Conversation
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 misses integration tests that point at what was fixed.
Hey @r1tsuu Thanks for the feedback! I've gone ahead and added two Thank you! |
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.
Awesome
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.
Looks good to me, let's also hear @DanRibbens's feedback.
What?
This PR fixes an issue while using
text
&number
fields withhasMany: true
where the last entry would be unreachable, and thus undeletable, because thetransformForWrite
function did not track these rows for deletion. This causes values that should've been deleted to remain in the edit view form, as well as the db, after a submission.This PR also properly threads the placeholder value from
admin.placeholder
totext
&number
hasMany: true
fields.Why?
To remove rows from the db when a submission is made where these fields are empty arrays, and to properly show an appropriate placeholder when one is set in config.
How?
Adjusting
transformForWrite
and thetraverseFields
to keep track of rows for deletion.Fixes #11781
Before:
Editing---Post-dbpg-before--Payload.webm
After:
Editing---Post--dbpg-hasmany-after-Payload.webm