We don’t currently have tools to automatically build bulk action endpoints (although I’d very much like to do this).
So for this you’d need to define a generic action
defmodule YourCustomMapTypeOfFields do
use Ash.Type.NewType, subtype_of: :map, constraints: [
fields: [
field1: [type: :integer, ...]
....
]
]
end
action :bulk_create, {:array, __MODULE__} do
argument :inputs, {:array, YourCustomMapTypeOfFields}, allow_nil?: false
run fn input, _ ->
# use Ash.bulk_create with `input.arguments.inputs`
end
end
Then you can use route/3 to make a generic action route:
route :post, "/path/to/your/route", :bulk_create






















