memory view in chat client
This commit is contained in:
@@ -219,4 +219,21 @@ export async function updateSessionProject(sessionId, projectId) {
|
||||
});
|
||||
if (!res.ok) throw new Error(`Failed to update session project: ${res.status}`);
|
||||
return res.json();
|
||||
}
|
||||
|
||||
export async function getEpisodes({ limit = 50, offset = 0, sessionId, q } = {}) {
|
||||
const url = new URL(`${BASE}/episodes`);
|
||||
url.searchParams.set('limit', limit);
|
||||
url.searchParams.set('offset', offset);
|
||||
if (sessionId) url.searchParams.set('sessionId', sessionId);
|
||||
if (q) url.searchParams.set('q', q);
|
||||
|
||||
const res = await fetch(url.toString());
|
||||
if (!res.ok) throw new Error(`Failed to fetch episodes: ${res.status}`);
|
||||
return res.json(); // { episodes, total }
|
||||
}
|
||||
|
||||
export async function deleteEpisode(id) {
|
||||
const res = await fetch(`${BASE}/episodes/${id}`, { method: 'DELETE' });
|
||||
if (!res.ok) throw new Error(`Failed to delete episode: ${res.status}`);
|
||||
}
|
||||
Reference in New Issue
Block a user