Changeset 2b4252c in Klonkt for src/services/guardianship/follows.js
- Timestamp:
- 07/25/2026 09:15:34 AM (7 weeks ago)
- Branches:
- main
- Children:
- 4f15f67
- Parents:
- af5b79b
- File:
-
- 1 edited
-
src/services/guardianship/follows.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/services/guardianship/follows.js
raf5b79b r2b4252c 73 73 export function remove(id) { stmts().del.run(id); } 74 74 75 export default { recordPending, getPending, listForWard, decide, remove }; 75 // ── Guardian-side copy (cross-instance, modelled on the guardian offer): a 76 // gated follow on a REMOTE ward this account guards, forwarded here as an 77 // Offer(Follow). The decision is Accept/Reject sent back to ward_inbox. ── 78 let _r = null; 79 function rstmts() { 80 if (!_r) { 81 _r = { 82 ins: db.prepare(`INSERT OR IGNORE INTO ap_follow_reviews 83 (id, guardian_slug, ward_uri, ward_inbox, follower_uri, follower_handle, follower_icon, follow_json, created_at) 84 VALUES (?,?,?,?,?,?,?,?, CURRENT_TIMESTAMP)`), 85 get: db.prepare('SELECT * FROM ap_follow_reviews WHERE guardian_slug = ? AND id = ?'), 86 bySlug: db.prepare("SELECT * FROM ap_follow_reviews WHERE guardian_slug = ? AND status = 'pending' ORDER BY created_at DESC"), 87 del: db.prepare('DELETE FROM ap_follow_reviews WHERE guardian_slug = ? AND id = ?'), 88 }; 89 } 90 return _r; 91 } 92 93 export function recordReview(guardianSlug, r) { 94 rstmts().ins.run(r.id, guardianSlug, r.wardUri, r.wardInbox || null, r.follower, r.followerHandle || null, r.followerIcon || null, r.followJson || null); 95 return rstmts().get.get(guardianSlug, r.id); 96 } 97 export function getReview(guardianSlug, id) { return rstmts().get.get(guardianSlug, id); } 98 export function listReviews(guardianSlug) { return rstmts().bySlug.all(guardianSlug); } 99 export function removeReview(guardianSlug, id) { rstmts().del.run(guardianSlug, id); } 100 101 export default { 102 recordPending, getPending, listForWard, decide, remove, 103 recordReview, getReview, listReviews, removeReview, 104 };
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)