Skip to content

Commit 04ff9f3

Browse files
committed
Save decision to DB on every RELEVANT/NOT RELEVANT click
1 parent 4aecebf commit 04ff9f3

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

web/src/App.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,17 @@ function ReviewPanel({ sample, isStatic = false, claudeRelevance = {} }) {
459459
return filtered.filter((r) => liliiaDecisions[r.row_uid]).length;
460460
}, [filtered, liliiaDecisions]);
461461

462-
function saveLiliiaDecision(uid, decision, notes) {
462+
async function saveLiliiaDecision(uid, decision, notes) {
463463
const updated = { ...liliiaDecisions, [uid]: { decision, notes, saved_at: new Date().toISOString() } };
464464
setLiliiaDecisions(updated);
465465
localStorage.setItem("liliia_decisions", JSON.stringify(updated));
466+
if (!isStatic) {
467+
await authFetch("/api/reviews", {
468+
method: "POST",
469+
headers: { "Content-Type": "application/json" },
470+
body: JSON.stringify({ row_uid: uid, judgment: decision, notes: notes || "" }),
471+
});
472+
}
466473
}
467474

468475
function exportDecisions() {

0 commit comments

Comments
 (0)