Skip to content

Commit 4e4819e

Browse files
committed
fix: revert standard
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
1 parent 18a2168 commit 4e4819e

4 files changed

Lines changed: 12 additions & 11 deletions

File tree

backend/src/api/public/v1/stewardships/assignSteward.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ import { getPackagesQx } from '@/db/packagesDb'
88
import { ok } from '@/utils/api'
99
import { validateOrThrow } from '@/utils/validation'
1010

11-
import { stewardshipIdParamsSchema } from './schemas'
11+
const paramsSchema = z.object({
12+
id: z.coerce.number().int().positive(),
13+
})
1214

1315
const bodySchema = z.object({
1416
userId: z.string().trim().min(1),
1517
role: z.enum(['lead', 'co_steward']),
1618
})
1719

1820
export async function assignStewardHandler(req: Request, res: Response): Promise<void> {
19-
const { id } = validateOrThrow(stewardshipIdParamsSchema, req.params)
21+
const { id } = validateOrThrow(paramsSchema, req.params)
2022
const { userId, role } = validateOrThrow(bodySchema, req.body)
2123

2224
const qx = await getPackagesQx()

backend/src/api/public/v1/stewardships/escalate.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ import { getPackagesQx } from '@/db/packagesDb'
88
import { ok } from '@/utils/api'
99
import { validateOrThrow } from '@/utils/validation'
1010

11-
import { stewardshipIdParamsSchema } from './schemas'
11+
const paramsSchema = z.object({
12+
id: z.coerce.number().int().positive(),
13+
})
1214

1315
const bodySchema = z.object({
1416
resolutionPath: z.enum(ESCALATION_RESOLUTION_PATHS),
1517
notes: z.string().trim().min(1).optional(),
1618
})
1719

1820
export async function escalateHandler(req: Request, res: Response): Promise<void> {
19-
const { id } = validateOrThrow(stewardshipIdParamsSchema, req.params)
21+
const { id } = validateOrThrow(paramsSchema, req.params)
2022
const { resolutionPath, notes } = validateOrThrow(bodySchema, req.body)
2123

2224
const qx = await getPackagesQx()

backend/src/api/public/v1/stewardships/schemas.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

backend/src/api/public/v1/stewardships/updateStatus.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import { getPackagesQx } from '@/db/packagesDb'
1212
import { ok } from '@/utils/api'
1313
import { validateOrThrow } from '@/utils/validation'
1414

15-
import { stewardshipIdParamsSchema } from './schemas'
15+
const paramsSchema = z.object({
16+
id: z.coerce.number().int().positive(),
17+
})
1618

1719
const bodySchema = z
1820
.object({
@@ -26,7 +28,7 @@ const bodySchema = z
2628
})
2729

2830
export async function updateStatusHandler(req: Request, res: Response): Promise<void> {
29-
const { id } = validateOrThrow(stewardshipIdParamsSchema, req.params)
31+
const { id } = validateOrThrow(paramsSchema, req.params)
3032
const { status, inactiveReason, notes } = validateOrThrow(bodySchema, req.body)
3133

3234
const qx = await getPackagesQx()

0 commit comments

Comments
 (0)