ash_blog/test/support/blog/post.ex

25 lines
505 B
Elixir
Raw Normal View History

2022-10-29 04:21:13 +13:00
defmodule AshBlog.Test.Post do
2022-10-29 04:40:14 +13:00
@moduledoc false
2022-10-29 04:21:13 +13:00
use Ash.Resource,
2024-04-03 05:15:56 +13:00
domain: AshBlog.Test.Domain,
2022-10-29 04:21:13 +13:00
otp_app: :ash_blog,
data_layer: AshBlog.DataLayer
actions do
2024-04-03 05:15:56 +13:00
default_accept :*
defaults [:create, :read, :update]
2022-10-29 04:21:13 +13:00
end
attributes do
uuid_primary_key :id
end
code_interface do
define :create, args: [:title, :body]
define :read, action: :read
define :stage, action: :stage
define :publish, action: :publish
define :archive, action: :archive
end
end