-
-
Notifications
You must be signed in to change notification settings - Fork 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
Bulk update #2311
Bulk update #2311
Conversation
Unnecessary because root filters don't have an EmbedPath(it's empty)
a184cbc
to
4517c77
Compare
c17b954
to
9dda69e
Compare
d04ec4c
to
7bc05d3
Compare
it "does not work when no limit query or filter is given" $ | ||
request methodPatch "/limited_update_items" | ||
[("Prefer", "tx=commit"), ("Prefer", "count=exact")] | ||
[json| {"name": "updated-item"} |] | ||
`shouldRespondWith` | ||
"" | ||
{ matchStatus = 404 | ||
, matchHeaders = [ matchHeaderAbsent hContentType | ||
, "Content-Range" <:> "*/0" ] | ||
} | ||
|
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 error was just a lucky side-effect of #2343. This needs a clear error message plus a 422 status - like done for batch delete.
request methodPatch "/bulk_update_items" | ||
[("Prefer", "tx=commit")] | ||
[json|[ | ||
{ "id": 1, "name": "item-1 - 1st", "observation": "Lost item" } | ||
, { "id": 3, "name": "item-3 - 3rd", "observation": null } | ||
]|] | ||
`shouldRespondWith` | ||
"" | ||
{ matchStatus = 204 | ||
, matchHeaders = [ matchHeaderAbsent hContentType | ||
, "Content-Range" <:> "0-1/*" | ||
, "Preference-Applied" <:> "tx=commit" ] | ||
} |
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.
Using the pks as filters without the option to reference other key in the body is too arbitrary. We need to be able to refer to every key, like bulk delete does.
For this, we'd need underscore operators.
- Revert patch #2311 - Keep the refactor done to qsFiltersRoot - Keep the refactor done to the items tables - Add tests that now work with pg-safeupdate as a result
Closes #1959.
TODO