Working with Transactions
Hello!
I'm working on converting the following Elixir/Ecto function into an Ash action:
This function performs two operations within a transaction:
Creates a new Team with the provided attributes.
Creates a new TeamMember associated with the newly created team and assigns the "admin" role to the specified user.
Here's my current Team resource definition in Ash:
I'm looking for guidance on how to implement the :create_team action in Ash to replicate the behavior of the original Ecto.Multi function. Specifically, I want to ensure that both the team creation and the associated team member creation occur within the same transaction.
I'm working on converting the following Elixir/Ecto function into an Ash action:
This function performs two operations within a transaction:
Creates a new Team with the provided attributes.
Creates a new TeamMember associated with the newly created team and assigns the "admin" role to the specified user.
Here's my current Team resource definition in Ash:
I'm looking for guidance on how to implement the :create_team action in Ash to replicate the behavior of the original Ecto.Multi function. Specifically, I want to ensure that both the team creation and the associated team member creation occur within the same transaction.
