unable to get to either add_another_user or add_moar_users update (#154)

actions on user
This commit is contained in:
Jeremy Grant 2024-05-22 23:23:12 +10:00 committed by GitHub
parent afcc7ae266
commit 78c9b6c977
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,20 @@
defmodule Demo.Accounts.NewUser do
@moduledoc """
TODO
"""
use Ash.Resource, data_layer: :embedded
actions do
defaults [:create]
end
attributes do
uuid_primary_key :id
attribute :email, :string, allow_nil?: false
attribute :first_name, :string, allow_nil?: false
attribute :last_name, :string, allow_nil?: false
attribute :mobile, :string, allow_nil?: false
attribute :address, :string, allow_nil?: false
end
end

View file

@ -61,6 +61,14 @@ defmodule Demo.Accounts.User do
update :update, primary?: true
update :update2
destroy :destroy
update :add_another_user do
argument :new_user, Demo.Accounts.NewUser, allow_nil?: false
end
update :add_moar_users do
argument :new_users, {:array, Demo.Accounts.NewUser}, allow_nil?: false
end
end
postgres do