feat: add knowledge graph component and persistent handbook sync state collection
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user