Fix reload e clear session utente
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user