destroy action based on filters
I currently have a read action and I pass the result to the default destroy action, is it possible to have a destroy action which includes the read part? It seems like destroy only works when passing along the objects
So basically I want to destroy the results of
Solution:Jump to solution
okay so you want to call it via a code interface. you can add the option
require_reference?: false
to the code interface, and then provide your own filters etc. in the action. (make sure to specify filters or it will delete everything)5 Replies
how are you calling the destroy action?
Currently doing this which works fine, I was just wondering if I could change the type of the action to a destroy, but then it seems to always require a route anyway
Solution
okay so you want to call it via a code interface. you can add the option
require_reference?: false
to the code interface, and then provide your own filters etc. in the action. (make sure to specify filters or it will delete everything)You can also provide a query as the reference
Route.delete(Ash.Query.filter(Route, ...))
Thanks that works!