bulk episodic deletion
This commit is contained in:
@@ -133,6 +133,23 @@ async function getProject(id) {
|
||||
return res.json();
|
||||
}
|
||||
|
||||
async function getEpisodes({ limit = 50, offset = 0, sessionId, q } = {}) {
|
||||
const url = new URL(`${BASE_URL}/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();
|
||||
}
|
||||
|
||||
async function deleteEpisode(id) {
|
||||
const res = await fetch(`${BASE_URL}/episodes/${id}`, { method: 'DELETE' });
|
||||
if (!res.ok) throw new Error(`Failed to delete episode: ${res.status}`);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getSessionByExternalId,
|
||||
createSession,
|
||||
@@ -149,4 +166,6 @@ module.exports = {
|
||||
deleteProject,
|
||||
getProjectSessions,
|
||||
getProject,
|
||||
getEpisodes,
|
||||
deleteEpisode,
|
||||
}
|
||||
Reference in New Issue
Block a user