mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-26 00:05:45 +00:00
refactor(FE): Remove unused imports and redundant code
This commit is contained in:
+2
-2
@@ -55,7 +55,7 @@ const TransferToLayingConfirmationModalTable = ({
|
||||
transferToLayingId
|
||||
? ['detail-transfer-to-laying', String(transferToLayingId)]
|
||||
: undefined,
|
||||
([_, id]) => TransferToLayingApi.getSingle(Number(id))
|
||||
([id]) => TransferToLayingApi.getSingle(Number(id))
|
||||
);
|
||||
|
||||
const confirmationTableColumns: ColumnDef<TransferToLayingConfirmationTableDataType>[] =
|
||||
@@ -230,7 +230,7 @@ const TransferToLayingConfirmationModal = ({
|
||||
text: primaryButton?.text ?? 'Oke',
|
||||
color: primaryButton?.color ?? 'primary',
|
||||
className: 'rounded-lg',
|
||||
onClick: (e) => {
|
||||
onClick: () => {
|
||||
if (withNote) {
|
||||
primaryButton?.onClick?.(notes);
|
||||
} else if (primaryButton && primaryButton?.onClick) {
|
||||
|
||||
@@ -40,10 +40,7 @@ const TransferToLayingDetailModal = () => {
|
||||
? transferToLayingResponse.data
|
||||
: undefined;
|
||||
|
||||
const {
|
||||
data: transferToLayingApprovalResponse,
|
||||
isLoading: isLoadingTransferToLayingApproval,
|
||||
} = useSWR(
|
||||
const { data: transferToLayingApprovalResponse } = useSWR(
|
||||
transferToLayingId
|
||||
? ['approval-transfer-to-laying', transferToLayingId]
|
||||
: undefined,
|
||||
|
||||
@@ -60,13 +60,12 @@ const TransferToLayingFormModal = () => {
|
||||
);
|
||||
};
|
||||
|
||||
const { data: transferToLaying, isLoading: isLoadingTransferToLaying } =
|
||||
useSWR(
|
||||
isModalActionForForm && transferToLayingId
|
||||
? ['detail-transfer-to-laying', transferToLayingId]
|
||||
: undefined,
|
||||
([, id]) => TransferToLayingApi.getSingle(Number(id))
|
||||
);
|
||||
const { data: transferToLaying } = useSWR(
|
||||
isModalActionForForm && transferToLayingId
|
||||
? ['detail-transfer-to-laying', transferToLayingId]
|
||||
: undefined,
|
||||
([, id]) => TransferToLayingApi.getSingle(Number(id))
|
||||
);
|
||||
|
||||
/**
|
||||
* Step 1: General Information
|
||||
@@ -178,7 +177,7 @@ const TransferToLayingFormModal = () => {
|
||||
[router]
|
||||
);
|
||||
|
||||
const [formikInitialValues, setFormikInitialValues] = useState(
|
||||
const [formikInitialValues] = useState(
|
||||
getTransferToLayingFormInitialValues()
|
||||
);
|
||||
|
||||
@@ -238,10 +237,7 @@ const TransferToLayingFormModal = () => {
|
||||
)
|
||||
: undefined;
|
||||
|
||||
const {
|
||||
data: flockSourceKandangsAvailability,
|
||||
isLoading: isLoadingFlockSourceKandangsAvailability,
|
||||
} = useSWR(
|
||||
const { data: flockSourceKandangsAvailability } = useSWR(
|
||||
formik.values.flockSource
|
||||
? [
|
||||
'transfer-to-laying',
|
||||
@@ -297,10 +293,7 @@ const TransferToLayingFormModal = () => {
|
||||
return { available: countAvailable, unavailable: countUnavailable };
|
||||
}, [mappedFlockSourceKandangsAvailability]);
|
||||
|
||||
const {
|
||||
data: flockDestinationKandangsMaxTargetQty,
|
||||
isLoading: isLoadingFlockDestinationKandangsMaxTargetQty,
|
||||
} = useSWR(
|
||||
const { data: flockDestinationKandangsMaxTargetQty } = useSWR(
|
||||
formik.values.flockDestination
|
||||
? [
|
||||
'transfer-to-laying',
|
||||
|
||||
@@ -2,9 +2,6 @@ import * as Yup from 'yup';
|
||||
import { TransferToLaying } from '@/types/api/production/transfer-to-laying';
|
||||
import { TransferToLayingApi } from '@/services/api/production/transfer-to-laying';
|
||||
import { formatDate, formatNumber } from '@/lib/helper';
|
||||
import { ProjectFlock } from '@/types/api/production/project-flock';
|
||||
import { ProjectFlockApi } from '@/services/api/production/project-flock';
|
||||
import { isResponseSuccess } from '@/lib/api-helper';
|
||||
|
||||
type TransferToLayingFormSchemaType = {
|
||||
transfer_date?: string;
|
||||
|
||||
Reference in New Issue
Block a user