This commit is contained in:
@@ -70,6 +70,13 @@ export async function PATCH(req: NextRequest, ctx: { params: Promise<{ id: strin
|
||||
data: {
|
||||
...(body.templateId !== undefined ? { templateId: body.templateId } : {}),
|
||||
...(body.name !== undefined ? { name: body.name } : {}),
|
||||
// Switching to kind="qc" implicitly flips qcRequired on (an inspection
|
||||
// step without mandatory QC is a contradiction). Switching back to
|
||||
// kind="work" leaves qcRequired alone — the admin can toggle it
|
||||
// explicitly if they want to drop the check.
|
||||
...(body.kind !== undefined
|
||||
? { kind: body.kind, ...(body.kind === "qc" ? { qcRequired: true } : {}) }
|
||||
: {}),
|
||||
...(body.machineId !== undefined ? { machineId: body.machineId } : {}),
|
||||
...(body.settings !== undefined ? { settings: body.settings } : {}),
|
||||
...(body.materialNotes !== undefined ? { materialNotes: body.materialNotes } : {}),
|
||||
|
||||
Reference in New Issue
Block a user