diff --git a/src/app/(main)/m/admin/orders/page.tsx b/src/app/(main)/m/admin/orders/page.tsx index bfd65cd..1d575a8 100644 --- a/src/app/(main)/m/admin/orders/page.tsx +++ b/src/app/(main)/m/admin/orders/page.tsx @@ -531,6 +531,25 @@ function StatementPreview({ else Swal.fire({ icon: "error", title: "수량 저장 실패", text: j.message }); }; + // ITEM 라인 삭제 — items/update API delete 옵션 + const deleteItemLine = async (lineObjid: string, itemName: string) => { + const ok = await Swal.fire({ + icon: "question", + title: `${itemName} 품목을 삭제하시겠습니까?`, + showCancelButton: true, + confirmButtonColor: "#dc2626", + confirmButtonText: "삭제", + }); + if (!ok.isConfirmed) return; + const res = await fetch("/api/m/orders/items/update", { + method: "POST", headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ orderObjid: order.OBJID, lines: [{ objid: lineObjid, delete: true }] }), + }); + const j = await res.json(); + if (j.success) { onReload(); onReloadList(); } + else Swal.fire({ icon: "error", title: "삭제 실패", text: j.message }); + }; + const upsertExtra = async (line: { objid?: string; kind: "DELIVERY" | "CHARTER"; label: string; unitPrice: number; qty: number }) => { const res = await fetch("/api/m/orders/lines/save", { method: "POST", headers: { "Content-Type": "application/json" }, @@ -776,7 +795,13 @@ function StatementPreview({ ? saveRemark(it.OBJID, r)} /> : {it.REMARK || ""}} - {editable && } + {editable && ( + + + + )} ); })}