2018-12-14 16:41:55 +00:00
|
|
|
defmodule MobilizonWeb.API.Comments do
|
|
|
|
@moduledoc """
|
2019-09-22 14:26:23 +00:00
|
|
|
API for Comments.
|
2018-12-14 16:41:55 +00:00
|
|
|
"""
|
|
|
|
alias Mobilizon.Events.Comment
|
|
|
|
alias Mobilizon.Service.ActivityPub
|
2019-10-25 15:43:37 +00:00
|
|
|
alias Mobilizon.Service.ActivityPub.Activity
|
2018-12-14 16:41:55 +00:00
|
|
|
|
|
|
|
@doc """
|
|
|
|
Create a comment
|
|
|
|
|
|
|
|
Creates a comment from an actor and a status
|
|
|
|
"""
|
2019-10-25 15:43:37 +00:00
|
|
|
@spec create_comment(map()) ::
|
2019-07-30 08:35:29 +00:00
|
|
|
{:ok, Activity.t(), Comment.t()} | any()
|
2019-10-25 15:43:37 +00:00
|
|
|
def create_comment(args) do
|
|
|
|
ActivityPub.create(:comment, args, true)
|
2018-12-14 16:41:55 +00:00
|
|
|
end
|
|
|
|
end
|