forked from potsda.mn/mobilizon
cc820d6b63
* Data doesn't need anymore to be converted to ActivityStream format to be saved (this was taken from Pleroma and not at all a good idea here) * Everything saved when creating an event is inserted into PostgreSQL in a single transaction
20 lines
454 B
Elixir
20 lines
454 B
Elixir
defmodule MobilizonWeb.API.Comments do
|
|
@moduledoc """
|
|
API for Comments.
|
|
"""
|
|
alias Mobilizon.Events.Comment
|
|
alias Mobilizon.Service.ActivityPub
|
|
alias Mobilizon.Service.ActivityPub.Activity
|
|
|
|
@doc """
|
|
Create a comment
|
|
|
|
Creates a comment from an actor and a status
|
|
"""
|
|
@spec create_comment(map()) ::
|
|
{:ok, Activity.t(), Comment.t()} | any()
|
|
def create_comment(args) do
|
|
ActivityPub.create(:comment, args, true)
|
|
end
|
|
end
|