changelog

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-02-22 12:10:44 +01:00
parent 2a78f4f786
commit 3b5d591808
2 changed files with 3 additions and 2 deletions

View file

@ -0,0 +1 @@
Allow to pin/unpip chats

View file

@ -224,14 +224,14 @@ defmodule Pleroma.Web.PleromaAPI.ChatController do
end
end
def pin(%{assigns: %{user: user}} = conn, %{id: id}) do
def pin(%{assigns: %{user: user}, private: %{open_api_spex: %{params: %{id: id}}}} = conn, _) do
with {:ok, chat} <- Chat.get_by_user_and_id(user, id),
{:ok, chat} <- Chat.pin(chat) do
render(conn, "show.json", chat: chat)
end
end
def unpin(%{assigns: %{user: user}} = conn, %{id: id}) do
def unpin(%{assigns: %{user: user}, private: %{open_api_spex: %{params: %{id: id}}}} = conn, _) do
with {:ok, chat} <- Chat.get_by_user_and_id(user, id),
{:ok, chat} <- Chat.unpin(chat) do
render(conn, "show.json", chat: chat)