- What I’ve Tried Checked Ash JSON API relationship manipulation docs - Attempted to manually create the leads inside a change block using Ash.Changeset.manage_relationship/4 relevant code:
# my domain#... code for doamins base_route "/location", ProjectX.Leads.Location do post :create end
# my domain#... code for doamins base_route "/location", ProjectX.Leads.Location do post :create end
---
# location resource actions do create :create do accept([:name, :location, :images]) argument(:leads, {:array, :map}, allow_nil?: true) change(fn changeset, _ctx -> # should I do it here end) end# Ash.Changeset.manage_relationship(changeset, :leads, leads, type: :create) # should I do it as a relashionship? relationships do has_many :leads, ProjectX.Leads.Lead endend
# location resource actions do create :create do accept([:name, :location, :images]) argument(:leads, {:array, :map}, allow_nil?: true) change(fn changeset, _ctx -> # should I do it here end) end# Ash.Changeset.manage_relationship(changeset, :leads, leads, type: :create) # should I do it as a relashionship? relationships do has_many :leads, ProjectX.Leads.Lead endend
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.