feat: add knowledge graph component and persistent handbook sync state collection

This commit is contained in:
RaymondVerhoef
2026-05-18 21:13:17 +02:00
parent 9f3e1113a6
commit f35550f270
3 changed files with 191 additions and 16 deletions

View File

@@ -308,3 +308,20 @@ export async function bulkSetCurriculum(year, weeks) {
);
}
// ── Handbook Sync State ───────────────────────────────────────────────────────
export async function getHandbookSyncStates() {
try {
return await pb.collection('handbook_sync_state').getFullList();
} catch { return []; }
}
export async function updateHandbookSyncState(path, sha) {
try {
const r = await pb.collection('handbook_sync_state').getFirstListItem(`path="${path}"`);
return await pb.collection('handbook_sync_state').update(r.id, { sha });
} catch {
return await pb.collection('handbook_sync_state').create({ path, sha });
}
}