mirror of
https://github.com/ash-project/ash_admin.git
synced 2024-09-19 12:53:28 +12:00
unable to get to either add_another_user or add_moar_users update (#154)
actions on user
This commit is contained in:
parent
afcc7ae266
commit
78c9b6c977
2 changed files with 28 additions and 0 deletions
20
dev/resources/accounts/resources/new_user.ex
Normal file
20
dev/resources/accounts/resources/new_user.ex
Normal 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
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue