refactor: remove handbook sync state and related functionality
This commit is contained in:
@@ -349,11 +349,10 @@ export async function getRecentLlmCalls(limit = 100) {
|
||||
*
|
||||
* `team_members`, `settings`, and `llm_calls` are intentionally preserved.
|
||||
*
|
||||
* @param {{ includeHandbookState?: boolean, includeProgress?: boolean }} [opts]
|
||||
* @param {{ includeProgress?: boolean }} [opts]
|
||||
* @returns {Promise<Array<{collection: string, deleted: number, error?: string}>>}
|
||||
*/
|
||||
export async function resetForSmokeTest({
|
||||
includeHandbookState = true,
|
||||
includeProgress = false,
|
||||
} = {}) {
|
||||
const collections = [
|
||||
@@ -366,7 +365,6 @@ export async function resetForSmokeTest({
|
||||
'sources',
|
||||
'topics',
|
||||
];
|
||||
if (includeHandbookState) collections.push('handbook_sync_state');
|
||||
if (includeProgress) collections.push('learn_progress', 'leaderboard');
|
||||
|
||||
const results = [];
|
||||
@@ -388,20 +386,4 @@ export async function resetForSmokeTest({
|
||||
return results;
|
||||
}
|
||||
|
||||
// ── 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