Add 'packages/backend/' from commit 'acce648ee5e7e3a3006451e637c0db654820cc48'

git-subtree-dir: packages/backend
git-subtree-mainline: d0babd62af
git-subtree-split: acce648ee5
This commit is contained in:
Oliver Bryan
2025-12-13 20:21:47 +00:00
33 changed files with 1306 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import type { BunRequest } from "bun";
import { getIssuesByProject, getProjectByBlob } from "../../db/queries";
export default async function issuesInProject(req: BunRequest<"/issues/:projectBlob">) {
const { projectBlob } = req.params;
const project = await getProjectByBlob(projectBlob);
if (!project) {
return new Response(`project not found: provided ${projectBlob}`, { status: 404 });
}
const issues = await getIssuesByProject(project.id);
return Response.json(issues);
}

View File

@@ -0,0 +1,8 @@
import type { BunRequest } from "bun";
import { getIssues } from "../../db/queries";
export default async function issuesAll(req: BunRequest) {
const issues = await getIssues();
return Response.json(issues);
}