Ash FrameworkAF
Ash Framework3y ago
6 replies
Jason

submit_errors: [id: {"has already been taken", []}],

When a for_create form is submitted, I get this error. Assuming the
id
it's referring to is "form", I'm not sure why it thinks it has been taken.

  api: MyApp.Tweets,
  method: "post",
  submit_errors: [id: {"has already been taken", []}],
  id: "form",
  transform_errors: nil,
...


The form is created using apply_action called from the mount action (similar to the Ash twitter clone example).

  defp apply_action(socket, :new, _params) do
    current_user = socket.assigns.current_user

    form =
      AshPhoenix.Form.for_create(MyApp.Tweets.Tweet, :create,
        api: MyApp.Tweets,
        forms: [
          items: [
Was this page helpful?