chore: bypass dns using host ip
Some checks failed
Koori-ERP-Deploy / auto-deploy (push) Failing after 12s

This commit is contained in:
2025-12-30 17:05:19 +08:00
parent a11d967818
commit e15f85642c
5 changed files with 95 additions and 46 deletions

View File

@@ -256,4 +256,24 @@ class PurchaseOrderController extends Controller
return back()->withErrors(['error' => '更新失敗:' . $e->getMessage()]);
}
}
public function destroy($id)
{
try {
DB::beginTransaction();
$order = PurchaseOrder::findOrFail($id);
// Delete associated items first (due to FK constraints if not cascade)
$order->items()->delete();
$order->delete();
DB::commit();
return redirect()->route('purchase-orders.index')->with('success', '採購單已刪除');
} catch (\Exception $e) {
DB::rollBack();
return back()->withErrors(['error' => '刪除失敗:' . $e->getMessage()]);
}
}
}