backpex icon indicating copy to clipboard operation
backpex copied to clipboard

Ash: Support other actions than defaults

Open Flo0807 opened this issue 1 year ago • 0 comments

We need a way to configure other actions than defaults. Users should be able to configure the Ash action being used for destroying, reading and updating items. We also need a way of passing additional inputs as well as options to Ash functions, e.g., to provide the actor of the action.

We might create additional adapter options for the ash adapter that can be configured by users to return the action, input, and a list of options.

adapter_config: [
  resource: Demo.Helpdesk.Ticket,
  # returns a tuple with action name, inputs and options passed to the `update` action
  delete_all: fn assigns -> {:mydestroy, %{foo: "bar"}, actor: assigns.current_user} end
],

Flo0807 avatar Jan 31 '25 14:01 Flo0807