Skip to content

Commit

Permalink
unable to get to either add_another_user or add_moar_users update (#154)
Browse files Browse the repository at this point in the history
actions on user
  • Loading branch information
jeremygrant authored May 22, 2024
1 parent afcc7ae commit 78c9b6c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
20 changes: 20 additions & 0 deletions dev/resources/accounts/resources/new_user.ex
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions dev/resources/accounts/resources/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 78c9b6c

Please sign in to comment.