fixed issue type not being communicated during creation

This commit is contained in:
2026-01-29 20:42:54 +00:00
parent 2aa13e34bf
commit 106fc34aed
4 changed files with 11 additions and 8 deletions

View File

@@ -7,9 +7,10 @@ export async function createIssue(
title: string,
description: string,
creatorId: number,
status: string,
type: string,
sprintId?: number,
assigneeIds?: number[],
status?: string,
) {
// prevents two issues with the same unique number
return await db.transaction(async (tx) => {
@@ -31,7 +32,8 @@ export async function createIssue(
number: nextNumber,
creatorId,
sprintId,
...(status && { status }),
status,
type,
})
.returning();

View File

@@ -14,7 +14,7 @@ export default async function issueCreate(req: AuthedRequest) {
const parsed = await parseJsonBody(req, IssueCreateRequestSchema);
if ("error" in parsed) return parsed.error;
const { projectId, title, description = "", status, assigneeIds, sprintId } = parsed.data;
const { projectId, title, description = "", status, assigneeIds, sprintId, type } = parsed.data;
const project = await getProjectByID(projectId);
if (!project) {
@@ -51,9 +51,10 @@ export default async function issueCreate(req: AuthedRequest) {
title,
description,
req.userId,
status,
type,
sprintId ?? undefined,
assigneeIds,
status,
);
return Response.json(issue);