fix: remove unnecessary code

This commit is contained in:
ValdiANS
2026-05-18 14:25:19 +07:00
parent 82b5429d02
commit 910981645b
@@ -146,15 +146,6 @@ const DeliveryOrderProductForm = ({
); );
// ============ Fetch Data ============ // ============ Fetch Data ============
const { data: productData } = useSWR(
selectedProduct?.value
? ProductApi.basePath + '/' + selectedProduct?.value
: null,
() =>
selectedProduct?.value
? ProductApi.getSingle(Number(selectedProduct?.value))
: undefined
);
// Options Week dari minggu 1 - 22 // Options Week dari minggu 1 - 22
// const optionsWeek = useMemo(() => { // const optionsWeek = useMemo(() => {
@@ -440,7 +431,8 @@ const DeliveryOrderProductForm = ({
handleBlurField(currentInput); handleBlurField(currentInput);
formik.setFieldValue( formik.setFieldValue(
'uom', 'uom',
isResponseSuccess(productData) ? productData?.data?.uom?.name : '' initialValues?.marketing_product?.product_warehouse_data?.product?.uom
?.name ?? ''
); );
}, },
} }
@@ -813,9 +805,8 @@ const DeliveryOrderProductForm = ({
endAdornment={ endAdornment={
<div className='flex items-center gap-2'> <div className='flex items-center gap-2'>
<span className='text-sm text-gray-500'> <span className='text-sm text-gray-500'>
{isResponseSuccess(productData) {initialValues?.marketing_product?.product_warehouse_data
? productData?.data?.uom.name ?.product?.uom?.name ?? ''}
: ''}
</span> </span>
</div> </div>
} }
@@ -826,9 +817,8 @@ const DeliveryOrderProductForm = ({
(item) => item.id === formik.values.marketing_product_id (item) => item.id === formik.values.marketing_product_id
)?.qty + )?.qty +
' ' + ' ' +
(isResponseSuccess(productData) (initialValues?.marketing_product?.product_warehouse_data
? productData?.data?.uom.name ?.product?.uom?.name ?? '')
: '')
: '' : ''
} }
/> />