feat: batch material override — apply to all lines in an order at once

- POST /orders/{id}/batch-material-override endpoint
- Dropdown above the lines table: "Apply to all lines…"
- Options: clear all overrides, or select a library material
- Updates all order lines in one request

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-14 14:36:18 +01:00
parent 9d6def84c1
commit d84ce8252e
3 changed files with 71 additions and 1 deletions
+8
View File
@@ -244,6 +244,14 @@ export async function dispatchLineRender(orderId: string, lineId: string) {
return res.data
}
export async function batchMaterialOverride(orderId: string, materialOverride: string | null) {
const res = await api.post<{ updated: number; material_override: string | null }>(
`/orders/${orderId}/batch-material-override`,
{ material_override: materialOverride }
)
return res.data
}
export async function patchOrderLine(orderId: string, lineId: string, data: { material_override?: string | null }) {
const res = await api.patch<{ updated: boolean; line_id: string }>(
`/orders/${orderId}/lines/${lineId}`,