feat: admin settings

This commit is contained in:
Timothy J. Baek 2024-02-14 01:17:43 -08:00
parent b0a07e5265
commit 511e939b5d
13 changed files with 526 additions and 51 deletions

View file

@ -15,6 +15,7 @@
getChatListByTagName,
updateChatById
} from '$lib/apis/chats';
import toast from 'svelte-french-toast';
let show = false;
let navElement;
@ -64,10 +65,17 @@
};
const deleteChat = async (id) => {
goto('/');
const res = await deleteChatById(localStorage.token, id).catch((error) => {
toast.error(error);
chatDeleteId = null;
await deleteChatById(localStorage.token, id);
await chats.set(await getChatList(localStorage.token));
return null;
});
if (res) {
goto('/');
await chats.set(await getChatList(localStorage.token));
}
};
const saveSettings = async (updated) => {