project summaries addition
This commit is contained in:
@@ -181,7 +181,20 @@ async function getSummariesByProject(projectId) {
|
||||
if (!res.ok) throw new Error(`Failed to fetch summaries: ${res.status}`);
|
||||
return res.json();
|
||||
}
|
||||
// add to module.exports too
|
||||
|
||||
async function generateProjectSummary(projectId) {
|
||||
const res = await fetch(`${BASE_URL}/projects/${projectId}/summarize`, {
|
||||
method: 'POST',
|
||||
});
|
||||
if (!res.ok) throw new Error(`Failed to generate project summary: ${res.status}`);
|
||||
return res.json();
|
||||
}
|
||||
|
||||
async function getProjectOverviewSummary(projectId) {
|
||||
const res = await fetch(`${BASE_URL}/projects/${projectId}/overview`);
|
||||
if (!res.ok) throw new Error(`Failed to fetch project overview: ${res.status}`);
|
||||
return res.json(); // null if none exists yet
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getSessionByExternalId,
|
||||
@@ -205,4 +218,6 @@ module.exports = {
|
||||
createSummary,
|
||||
updateSummary,
|
||||
getSummariesByProject,
|
||||
generateProjectSummary,
|
||||
getProjectOverviewSummary,
|
||||
}
|
||||
Reference in New Issue
Block a user