mirror of
https://github.com/hex248/sprint.git
synced 2026-02-07 18:23:03 +00:00
15 lines
530 B
TypeScript
15 lines
530 B
TypeScript
import type { BunRequest } from "bun";
|
|
import { getIssuesWithAssigneeByProject, getProjectByKey } from "../../db/queries";
|
|
|
|
export default async function issuesInProject(req: BunRequest<"/issues/:projectKey">) {
|
|
const { projectKey } = req.params;
|
|
|
|
const project = await getProjectByKey(projectKey);
|
|
if (!project) {
|
|
return new Response(`project not found: provided ${projectKey}`, { status: 404 });
|
|
}
|
|
const issues = await getIssuesWithAssigneeByProject(project.id);
|
|
|
|
return Response.json(issues);
|
|
}
|