Fix reload e clear session utente

This commit is contained in:
Samuele E. Locatelli
2025-08-22 13:18:40 +00:00
parent 4ab66e8730
commit 8ae2028a78
+2 -2
View File
@@ -27,13 +27,13 @@ export default function App() {
};
const reloadHistory = async () => {
const res = await fetch(`/api/history?user_id=${userId}&session_id=${sessionId}`);
const res = await fetch(`/v1/history?user_id=${userId}&session_id=${sessionId}`);
const history = await res.json();
setMessages(history); // from useChatStream
};
const freshStart = async () => {
await fetch(`/api/v1/history?user_id=${userId}&session_id=${sessionId}`, { method: "DELETE" });
await fetch(`/v1/history?user_id=${userId}&session_id=${sessionId}`, { method: "DELETE" });
setMessages([]);
resetSessionId();
// or start a brand new sessionId: