mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 15:25:46 +00:00
refactor(FE-212,213): unify purchase API service references in Purchase components
This commit is contained in:
@@ -26,10 +26,7 @@ import {
|
||||
Purchase,
|
||||
PurchaseItem,
|
||||
} from '@/types/api/purchase/purchase';
|
||||
import {
|
||||
ManagerApprovalApi,
|
||||
PurchaseDeleteItemsApi,
|
||||
} from '@/services/api/purchase';
|
||||
import { PurchaseApi } from '@/services/api/purchase';
|
||||
import { isResponseError } from '@/lib/api-helper';
|
||||
import { toast } from 'react-hot-toast';
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
@@ -230,7 +227,7 @@ const PurchaseOrderDetail = ({
|
||||
return;
|
||||
}
|
||||
|
||||
const res = await ManagerApprovalApi.createManagerApproval(
|
||||
const res = await PurchaseApi.managerApproval.create(
|
||||
purchaseRequestId,
|
||||
payload
|
||||
);
|
||||
@@ -276,7 +273,7 @@ const PurchaseOrderDetail = ({
|
||||
setIsDeleteLoading(true);
|
||||
|
||||
try {
|
||||
const res = await PurchaseDeleteItemsApi.deleteItems(purchaseRequestId, {
|
||||
const res = await PurchaseApi.items.delete(purchaseRequestId, {
|
||||
item_ids: itemIdsToDelete,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user