Ash FrameworkAF
Ash Framework7mo ago
6 replies
quartz

Unable to send a `Ash.Type.File` as argument to action using `AshPhoenix.Form`

When trying to send a Ash.Type.File struct as an argument to an update action, AshPhoenix.Form is failing on validation.
Worth nothing that sending the file argument as :override_params in AshPhoenix.Form.submit does bypass this and work correctly, as does calling the action directly.

AshAdmin also exhibits this behaviour.

Am I doing something wrong or is this a bug? The action looks like this:
update :update_avatar do
  require_atomic? false
  accept []
  argument :avatar, Ash.Type.File, allow_nil?: true
  argument :filename, :string, allow_nil?: true

  change &handle_avatar/2 # actually saves the file and stores path to DB
end
Was this page helpful?