fix: get data sub category on modal product
This commit is contained in:
parent
a89566adc1
commit
81fffe4528
|
@ -1,33 +1,18 @@
|
||||||
import React, { useContext, useState } from "react";
|
import React, {useContext, useState} from "react";
|
||||||
import {
|
import {Button, Col, Divider, Form, Input, List, message, Modal, Row, Select, Table, Tag, Typography,} from "antd";
|
||||||
Button,
|
import {observer} from "mobx-react-lite";
|
||||||
Col,
|
import {ExclamationCircleOutlined} from "@ant-design/icons";
|
||||||
Form,
|
import {useHistory} from "react-router-dom";
|
||||||
Input,
|
import {useStore} from "../utils/useStore";
|
||||||
message,
|
import {LINKS} from "../routes/app";
|
||||||
Modal,
|
import {ModalLoaderContext} from "../utils/modal";
|
||||||
Row,
|
|
||||||
Select,
|
|
||||||
Table,
|
|
||||||
Divider,
|
|
||||||
Tag,
|
|
||||||
Typography,
|
|
||||||
List,
|
|
||||||
} from "antd";
|
|
||||||
import { observer } from "mobx-react-lite";
|
|
||||||
import { ExclamationCircleOutlined } from "@ant-design/icons";
|
|
||||||
import { useHistory } from "react-router-dom";
|
|
||||||
import { capitalize } from "lodash";
|
|
||||||
import { useStore } from "../utils/useStore";
|
|
||||||
import { LINKS } from "../routes/app";
|
|
||||||
import { ModalLoaderContext } from "../utils/modal";
|
|
||||||
|
|
||||||
const { Title, Text } = Typography;
|
const {Title, Text} = Typography;
|
||||||
|
|
||||||
export const ProductComponent = observer((props) => {
|
export const ProductComponent = observer((props) => {
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const { Option } = Select;
|
const {Option} = Select;
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const [idData, setIdData] = useState("");
|
const [idData, setIdData] = useState("");
|
||||||
const [filterSupplier, setFilterSupplier] = useState(null);
|
const [filterSupplier, setFilterSupplier] = useState(null);
|
||||||
|
@ -397,10 +382,10 @@ export const ProductComponent = observer((props) => {
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Select placeholder="Select Sub Category" allowClear>
|
<Select placeholder="Select Sub Category" allowClear>
|
||||||
{store.product.dataSubCategories.map((item) => (
|
{store.category.dataSubCategories.map((item) => (
|
||||||
<Option value={item.id} key={item.id}>
|
<Option value={item.id} key={item.id}>
|
||||||
{item.name}
|
{item.name}
|
||||||
</Option>
|
</Option>
|
||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React, {useContext, useEffect} from "react";
|
import React, {useContext, useEffect} from "react";
|
||||||
import {Button, Card, Col, Input, Row, Upload,message} from "antd";
|
import {Button, Card, Col, Input, message, Row, Upload} from "antd";
|
||||||
import {FilterOutlined, PlusSquareOutlined, UploadOutlined,} from "@ant-design/icons";
|
import {FilterOutlined, PlusSquareOutlined, UploadOutlined,} from "@ant-design/icons";
|
||||||
import {BreadcumbComponent} from "../../component/BreadcumbComponent";
|
import {BreadcumbComponent} from "../../component/BreadcumbComponent";
|
||||||
import {useStore} from "../../utils/useStore";
|
import {useStore} from "../../utils/useStore";
|
||||||
|
@ -20,8 +20,8 @@ export const Product = observer(() => {
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
await Promise.allSettled([
|
await Promise.allSettled([
|
||||||
store.supplier.getData(),
|
store.supplier.getData(),
|
||||||
store.product.getDataCategories(),
|
|
||||||
store.category.getData(),
|
store.category.getData(),
|
||||||
|
store.category.getDataSubCategories(),
|
||||||
]);
|
]);
|
||||||
await store.product.getData();
|
await store.product.getData();
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user