Update activity

This commit is contained in:
Mirai Kumiko 2025-06-29 20:53:48 +02:00
parent 0c2777eb12
commit 144bfb57e2
Signed by: miraikumiko
GPG key ID: 3F178B1B5E0CB278
2 changed files with 5 additions and 1 deletions

View file

@ -11,6 +11,8 @@ defmodule Nulla.Models.Activity do
field :type, :string
field :actor, :string
field :object, :string
field :to, :string
field :cc, :string
timestamps()
end
@ -18,7 +20,7 @@ defmodule Nulla.Models.Activity do
@doc false
def changeset(activity, attrs) do
activity
|> cast(attrs, [:ap_id, :type, :actor, :object])
|> cast(attrs, [:ap_id, :type, :actor, :object, :to, :cc])
|> validate_required([:ap_id, :type, :actor, :object])
|> validate_inclusion(:type, ~w(Create Update Delete Undo Like Announce Follow Accept Reject))
end

View file

@ -8,6 +8,8 @@ defmodule Nulla.Repo.Migrations.CreateActivities do
add :type, :string, null: false
add :actor, :string, null: false
add :object, :text, null: false
add :to, :text
add :cc, :text
timestamps()
end