fix bug and errors
This commit is contained in:
@@ -33,14 +33,14 @@ export function useDeleteChat() {
|
||||
if (!res.ok) {
|
||||
let body;
|
||||
try { body = await res.json(); } catch { body = null; }
|
||||
throw new Error(body?.message || t('chat.deleteErrorWithStatus', { status: res.status }));
|
||||
throw new Error(body?.message || t('chats.deleteErrorWithStatus', { status: res.status }));
|
||||
}
|
||||
|
||||
clearChatUnread(chatId);
|
||||
removePostForChat(chatId);
|
||||
return { success: true, error: null };
|
||||
} catch (err) {
|
||||
const message = err.message || t('chat.deleteError');
|
||||
const message = err.message || t('chats.deleteError');
|
||||
setError(message);
|
||||
return { success: false, error: message };
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user