Something went wrong. Try again.
spool is a community-first, lightweight discussion forum, issue tracker, and announcement hub for your project.
Something went wrong. Try again.
12345678910111213141516171819202122import { Hono } from "hono";import { requireAuth, type AuthEnv } from "../auth/session.js";import { applyTangledRepoDecisions, listPendingTangledRepos } from "../auth/tangledSync.js";
const router = new Hono<AuthEnv>();
// GET /api/tangled-repos/pending — Tangled repos found on this user's// account that haven't been accepted or declined for syncing yet.router.get("/pending", requireAuth, async (c) => { const repos = await listPendingTangledRepos(c.get("user")!.id); return c.json(repos);});
// POST /api/tangled-repos/decide — apply the user's sync choices.router.post("/decide", requireAuth, async (c) => { const data = await c.req.json<{ accepted?: string[]; declined?: string[] }>(); await applyTangledRepoDecisions(c.get("user")!.id, data.accepted ?? [], data.declined ?? []); return c.json({ ok: true });});
export default router;