You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.
However, this does not really work in real-life, since only POST requests deliver the expected results. Once you want to modify a records using PUT, this fails, because … well … the record exists already. In case of PUT/PATCH, I need to set up the validator to exclude the entity that’s being updated, like this:
But I don’t know how to inject the requested entity’s ID into the options array. Wouldn’t it make sense, to have Apigility set these excludes for PUT/PATCH requests automatically?
The text was updated successfully, but these errors were encountered:
This CURRENT_ENTITY_ID is inside the route parameters of your RouteMatch. A route identifier does not belong inside the validator/input filter logic. You can make your own validator class where you inject the RouteMatch instance or you can move validation to your ResourceListener class and do the validation after your resolved your object from the database in your patch or update method.
I’m in running into a rather tricky situation, using NoRecordExists validtor within Apigility.
It’s quite easy to setup and force a field value to be unique like this:
However, this does not really work in real-life, since only POST requests deliver the expected results. Once you want to modify a records using PUT, this fails, because … well … the record exists already. In case of PUT/PATCH, I need to set up the validator to exclude the entity that’s being updated, like this:
But I don’t know how to inject the requested entity’s ID into the options array. Wouldn’t it make sense, to have Apigility set these excludes for PUT/PATCH requests automatically?
The text was updated successfully, but these errors were encountered: