chats: add chat avatars and profile view-only modal
All checks were successful
CI / test (push) Successful in 23s
All checks were successful
CI / test (push) Successful in 23s
This commit is contained in:
@@ -302,6 +302,17 @@ export async function updateChatTitle(chatId: number, title: string): Promise<Ch
|
||||
return data;
|
||||
}
|
||||
|
||||
export interface ChatProfilePatch {
|
||||
title?: string;
|
||||
description?: string | null;
|
||||
avatar_url?: string | null;
|
||||
}
|
||||
|
||||
export async function updateChatProfile(chatId: number, payload: ChatProfilePatch): Promise<Chat> {
|
||||
const { data } = await http.patch<Chat>(`/chats/${chatId}/profile`, payload);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function addChatMember(chatId: number, userId: number): Promise<ChatMember> {
|
||||
const { data } = await http.post<ChatMember>(`/chats/${chatId}/members`, { user_id: userId });
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user