added endpoints and routes to get sessions

This commit is contained in:
Storme-bit
2026-04-06 01:16:19 -07:00
parent 710107ce5a
commit 461438e81b
4 changed files with 39 additions and 1 deletions

View File

@@ -56,11 +56,20 @@ async function getSessionHistory(sessionId, limit = 20, offset = 0) {
return res.json();
}
async function getSessions(limit = 20, offset = 0) {
const res = await fetch(
`${BASE_URL}/sessions?limit${limit}&offset=${offset}`
);
if (!res.ok) throw new Error(`Failed to fetch sessions: ${res.status}`);
return res.json();
}
module.exports = {
getSessionByExternalId,
createSession,
getRecentEpisodes,
createEpisode,
getEpisodeById,
getSessionHistory
getSessionHistory,
getSessions
}