mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 18:33:01 +00:00
Project.blob -> Project.key
This commit is contained in:
14
packages/backend/src/routes/issues/[projectKey].ts
Normal file
14
packages/backend/src/routes/issues/[projectKey].ts
Normal file
@@ -0,0 +1,14 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user