feat(chats): add per-user pinned chats and pinned sorting
This commit is contained in:
@@ -198,6 +198,16 @@ export async function unarchiveChat(chatId: number): Promise<Chat> {
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function pinChat(chatId: number): Promise<Chat> {
|
||||
const { data } = await http.post<Chat>(`/chats/${chatId}/pin-chat`);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function unpinChat(chatId: number): Promise<Chat> {
|
||||
const { data } = await http.post<Chat>(`/chats/${chatId}/unpin-chat`);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function deleteMessage(messageId: number, forAll = false): Promise<void> {
|
||||
await http.delete(`/messages/${messageId}`, { params: { for_all: forAll } });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user