feat(app): port history saving features
This commit is contained in:
parent
c24edac16d
commit
bab5dba6e1
5 changed files with 94 additions and 11 deletions
|
|
@ -29,15 +29,12 @@ const DeleteChat = ({
|
|||
const handleDelete = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const res = await fetch(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/chats/${chatId}`,
|
||||
{
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
const res = await fetch(`/api/chats/${chatId}`, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
if (res.status != 200) {
|
||||
throw new Error('Failed to delete chat');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue