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 :*
|
2022-11-01 20:11:06 +13:00
|
|
|
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
|