refactor(FE-212): add DeletePurchaseRequestItemPayload and implement PurchaseDeleteItemsService

This commit is contained in:
rstubryan
2025-11-17 10:13:30 +07:00
parent 69a8899cac
commit 30ed70b669
6 changed files with 82 additions and 20 deletions
@@ -318,17 +318,17 @@ const PurchaseOrderDetail = ({
// ===== SUBMISSION HANDLER =====
const createManagerApprovalHandler = useCallback(
async (payload: CreateManagerApprovalRequestPayload) => {
const purchaseRequisitionId = searchParams.get('purchaseId')
const purchaseRequestId = searchParams.get('purchaseId')
? parseInt(searchParams.get('purchaseId')!)
: purchaseData?.id || 1;
if (!purchaseRequisitionId) {
toast.error('Purchase Requisition ID is required');
if (!purchaseRequestId) {
toast.error('Purchase Request ID is required');
return;
}
const res = await ManagerApprovalApi.createManagerApproval(
purchaseRequisitionId,
purchaseRequestId,
payload
);
@@ -377,6 +377,10 @@ const PurchaseOrderDetail = ({
};
const purchaseOrderColumns: ColumnDef<PurchaseItem>[] = [
{
header: 'No',
cell: (props) => props.row.index + 1,
},
{
accessorKey: 'product.name',
header: 'Produk',