forked from AkkomaGang/akkoma
Lint
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
cb76faece9
commit
8e040e098b
3 changed files with 6 additions and 5 deletions
|
@ -794,7 +794,7 @@ defp note_request do
|
||||||
properties: %{
|
properties: %{
|
||||||
comment: %Schema{
|
comment: %Schema{
|
||||||
type: :string,
|
type: :string,
|
||||||
description: "Account note body",
|
description: "Account note body"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
example: %{
|
example: %{
|
||||||
|
|
|
@ -441,7 +441,10 @@ def unblock(%{assigns: %{user: blocker, account: blocked}} = conn, _params) do
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc "POST /api/v1/accounts/:id/note"
|
@doc "POST /api/v1/accounts/:id/note"
|
||||||
def note(%{assigns: %{user: noter, account: target}, body_params: %{comment: comment}} = conn, _params) do
|
def note(
|
||||||
|
%{assigns: %{user: noter, account: target}, body_params: %{comment: comment}} = conn,
|
||||||
|
_params
|
||||||
|
) do
|
||||||
with {:ok, _user_note} <- UserNote.create(noter, target, comment) do
|
with {:ok, _user_note} <- UserNote.create(noter, target, comment) do
|
||||||
render(conn, "relationship.json", user: noter, target: target)
|
render(conn, "relationship.json", user: noter, target: target)
|
||||||
else
|
else
|
||||||
|
|
|
@ -10,8 +10,6 @@ def change do
|
||||||
timestamps()
|
timestamps()
|
||||||
end
|
end
|
||||||
|
|
||||||
create_if_not_exists(
|
create_if_not_exists(unique_index(:user_notes, [:source_id, :target_id]))
|
||||||
unique_index(:user_notes, [:source_id, :target_id])
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue