Skip to content

Commit 1574a7d

Browse files
Ripwordsclaude
andcommitted
feat(integration-api): expose autoCreateOnIntake toggle
Add autoCreateOnIntake field to GithubConfigDTO and UpdateGithubConfigInput, and wire it through GET + PATCH endpoints so the column is readable and patchable via the API. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 45eb032 commit 1574a7d

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

apps/dashboard/server/api/projects/[id]/integrations/github/index.get.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default defineEventHandler(async (event): Promise<GithubConfigDTO> => {
2626
defaultLabels: [],
2727
defaultAssignees: [],
2828
pushOnEdit: false,
29+
autoCreateOnIntake: false,
2930
lastSyncedAt: null,
3031
failedJobs: [],
3132
}
@@ -53,6 +54,7 @@ export default defineEventHandler(async (event): Promise<GithubConfigDTO> => {
5354
defaultLabels: gi.defaultLabels,
5455
defaultAssignees: gi.defaultAssignees,
5556
pushOnEdit: gi.pushOnEdit,
57+
autoCreateOnIntake: gi.autoCreateOnIntake,
5658
lastSyncedAt: gi.updatedAt.toISOString(),
5759
failedJobs: failedJobs.map((j) => ({
5860
reportId: j.reportId,

apps/dashboard/server/api/projects/[id]/integrations/github/index.patch.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ export default defineEventHandler(async (event) => {
2828
...(body.defaultLabels !== undefined ? { defaultLabels: body.defaultLabels } : {}),
2929
...(body.defaultAssignees !== undefined ? { defaultAssignees: body.defaultAssignees } : {}),
3030
...(body.pushOnEdit !== undefined ? { pushOnEdit: body.pushOnEdit } : {}),
31+
...(body.autoCreateOnIntake !== undefined
32+
? { autoCreateOnIntake: body.autoCreateOnIntake }
33+
: {}),
3134
updatedAt: new Date(),
3235
})
3336
.where(eq(githubIntegrations.projectId, projectId))

packages/shared/src/github.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const GithubConfigDTO = z.object({
99
defaultLabels: z.array(z.string()),
1010
defaultAssignees: z.array(z.string()),
1111
pushOnEdit: z.boolean(),
12+
autoCreateOnIntake: z.boolean(),
1213
lastSyncedAt: z.string().nullable(),
1314
failedJobs: z.array(
1415
z.object({
@@ -28,6 +29,7 @@ export const UpdateGithubConfigInput = z.object({
2829
defaultLabels: z.array(z.string().min(1).max(50)).max(20).optional(),
2930
defaultAssignees: z.array(z.string().min(1).max(50)).max(20).optional(),
3031
pushOnEdit: z.boolean().optional(),
32+
autoCreateOnIntake: z.boolean().optional(),
3133
})
3234
export type UpdateGithubConfigInput = z.infer<typeof UpdateGithubConfigInput>
3335

0 commit comments

Comments
 (0)