feat: a chat of the assistant is deleted at once, without asking

This commit is contained in:
redtea committed 2026-10-16 21:47:50 +03:00
1 parent 77322e8644
commit e0b3999d0c
1 file changed
-1
-1
View File
@@ -204,7 +204,6 @@
row.querySelector('.ai-chatopen').onclick = () => { openChat(c.id); toggleChats(false); }; row.querySelector('.ai-chatopen').onclick = () => { openChat(c.id); toggleChats(false); };
row.querySelector('.ai-chatdel').onclick = async ev => { row.querySelector('.ai-chatdel').onclick = async ev => {
ev.stopPropagation(); ev.stopPropagation();
if (!await UI.confirm('Удалить чат «' + c.title + '»?', {ok: 'Удалить', danger: true})) return;
await fetch('/api/panel/ai/chats/' + c.id + '/delete', {method: 'POST', credentials: 'same-origin'}); await fetch('/api/panel/ai/chats/' + c.id + '/delete', {method: 'POST', credentials: 'same-origin'});
if (c.id === chatId) openChat(0); if (c.id === chatId) openChat(0);
loadChats(); loadChats();