If I try to update a make, and only pass in some of the fields, any omitted ones are deleted. This throws when they're required/fail validation, and some just get cleared entirely.
Created attachment 754821 [details] [review] https://github.com/mozilla/MakeAPI/pull/62 I modified updateFields in the make routes so that it doesn't overwrite existing fields with `null` and I also make it concatenate tag arrays. Also have it checking if the createdAt field already exists, so that the time is put in updatedAt if the make already existed.
Attachment #754821 - Flags: review?(david.humphrey)
Summary: Updating a Make clears fields not trying to be updated → Updating a Make clears all fields with no new data
Comment on attachment 754821 [details] [review] https://github.com/mozilla/MakeAPI/pull/62 r+ with nits in PR.
Attachment #754821 - Flags: review?(david.humphrey) → review+
Commit pushed to master at https://github.com/mozilla/MakeAPI https://github.com/mozilla/MakeAPI/commit/b1362b16b0816eeaa73d4a4dafc1bc41427a05b8 Fix Bug 876527 - Don't overwrite existing make fields on an update, concatenate tag arrays, and determine which date field to timestamp.
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Attachment mime type: text/plain → text/x-github-pull-request
You need to log in before you can comment on or make changes to this bug.