added endpoints and routes to get sessions
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user