Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
properties: %{
comment: %Schema{
type: :string,
properties: %{
comment: %Schema{
type: :string,
- description: "Account note body",
+ description: "Account note body"
end
@doc "POST /api/v1/accounts/:id/note"
end
@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
render(conn, "relationship.json", user: noter, target: target)
else
with {:ok, _user_note} <- UserNote.create(noter, target, comment) do
render(conn, "relationship.json", user: noter, target: target)
else
- create_if_not_exists(
- unique_index(:user_notes, [:source_id, :target_id])
- )
+ create_if_not_exists(unique_index(:user_notes, [:source_id, :target_id]))