diff --git a/src/components/JoSearch/JoSearch.tsx b/src/components/JoSearch/JoSearch.tsx index 2cb7fd7..b05ee0d 100644 --- a/src/components/JoSearch/JoSearch.tsx +++ b/src/components/JoSearch/JoSearch.tsx @@ -16,7 +16,7 @@ import { Button, Stack } from "@mui/material"; import { BomCombo } from "@/app/api/bom"; import JoCreateFormModal from "./JoCreateFormModal"; import AddIcon from '@mui/icons-material/Add'; -import QcStockInModal from "../PoDetail/QcStockInModal"; +import QcStockInModal from "../Qc/QcStockInModal"; import { useSession } from "next-auth/react"; import { SessionWithTokens } from "@/config/authConfig"; import { createStockInLine } from "@/app/api/stockIn/actions"; @@ -25,17 +25,19 @@ import dayjs from "dayjs"; import { fetchInventories } from "@/app/api/inventory/actions"; import { InventoryResult } from "@/app/api/inventory"; +import { PrinterCombo } from "@/app/api/settings/printer"; interface Props { defaultInputs: SearchJoResultRequest, bomCombo: BomCombo[] + printerCombo: PrinterCombo[]; } type SearchQuery = Partial>; type SearchParamNames = keyof SearchQuery; -const JoSearch: React.FC = ({ defaultInputs, bomCombo }) => { +const JoSearch: React.FC = ({ defaultInputs, bomCombo, printerCombo }) => { const { t } = useTranslation("jo"); const router = useRouter() const [filteredJos, setFilteredJos] = useState([]); @@ -426,7 +428,7 @@ const JoSearch: React.FC = ({ defaultInputs, bomCombo }) => { open={openModal} onClose={closeNewModal} inputDetail={modalInfo} - printerCombo={[]} + printerCombo={printerCombo} // skipQc={true} /> diff --git a/src/components/JoSearch/JoSearchWrapper.tsx b/src/components/JoSearch/JoSearchWrapper.tsx index 7972d56..78470d6 100644 --- a/src/components/JoSearch/JoSearchWrapper.tsx +++ b/src/components/JoSearch/JoSearchWrapper.tsx @@ -3,6 +3,7 @@ import GeneralLoading from "../General/GeneralLoading"; import JoSearch from "./JoSearch"; import { SearchJoResultRequest } from "@/app/api/jo/actions"; import { fetchBomCombo } from "@/app/api/bom"; +import { fetchPrinterCombo } from "@/app/api/settings/printer"; interface SubComponents { Loading: typeof GeneralLoading; @@ -15,12 +16,14 @@ const JoSearchWrapper: React.FC & SubComponents = async () => { } const [ - bomCombo + bomCombo, + printerCombo ] = await Promise.all([ - fetchBomCombo() + fetchBomCombo(), + fetchPrinterCombo() ]) - return + return } JoSearchWrapper.Loading = GeneralLoading;