mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-23 23:05:46 +00:00
refactor(FE-208,212): enhance PurchaseRequestForm with product and product warehouse fields
This commit is contained in:
@@ -6,7 +6,7 @@ import { PurchaseApi } from '@/services/api/purchasing';
|
||||
import {
|
||||
CreatePurchaseRequestPayload,
|
||||
UpdatePurchaseRequestPayload,
|
||||
} from '@/types/api/purchase/purchasing';
|
||||
} from '@/types/api/purchase/purchase';
|
||||
import { isResponseError } from '@/lib/api-helper';
|
||||
|
||||
export const usePurchaseRequestFormHandlers = (initialValuesId?: number) => {
|
||||
@@ -30,7 +30,10 @@ export const usePurchaseRequestFormHandlers = (initialValuesId?: number) => {
|
||||
);
|
||||
|
||||
const updatePurchaseRequestHandler = useCallback(
|
||||
async (purchaseRequestId: number, payload: UpdatePurchaseRequestPayload) => {
|
||||
async (
|
||||
purchaseRequestId: number,
|
||||
payload: UpdatePurchaseRequestPayload
|
||||
) => {
|
||||
const res = await PurchaseApi.update(purchaseRequestId, payload);
|
||||
if (res?.status === 'error') {
|
||||
setPurchaseRequestFormErrorMessage(res.message);
|
||||
@@ -67,4 +70,4 @@ export const usePurchaseRequestFormHandlers = (initialValuesId?: number) => {
|
||||
deletePurchaseRequestClickHandler,
|
||||
confirmationModalDeleteClickHandler,
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user