16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/decidim/api/commentable_mutation_type.rb', line 16
def (body:, alignment: nil, user_group_id: nil)
params = { "comment" => { "body" => body, "alignment" => alignment, "user_group_id" => user_group_id, "commentable" => object } }
form = Decidim::Comments::CommentForm.from_params(params).with_context(
current_organization: context[:current_organization],
current_component: object.component
)
Decidim::Comments::CreateComment.call(form, context[:current_user]) do
on(:ok) do ||
return
end
end
end
|