feat: remove action column and handler filter modal product

This commit is contained in:
caturbgs
2021-12-17 02:20:50 +07:00
parent 51e92559e8
commit 068444fb07
3 changed files with 8 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
import React, {useState} from "react";
import {Button, Col, Form, Input, message, Modal, Row, Select, Space, Table, Tag, Typography} from "antd";
import {Button, Col, Form, Input, message, Modal, Row, Select, Table, Tag, Typography} from "antd";
import {observer} from "mobx-react-lite";
import {ExclamationCircleOutlined} from "@ant-design/icons";
import {useHistory} from "react-router-dom";
@@ -81,23 +81,7 @@ export const ProductComponent = observer((props) => {
{record?.status === "ACTIVE" ? " Ya" : "Tidak"}
</Tag>
),
},
{
title: "Action",
key: "action",
render: (text, record) => (
<Space size="middle">
<Button
onClick={() => handleEditButton(record)}
>Edit</Button>
<Button
onClick={() => handleDelete(record.id)}
>
Delete
</Button>
</Space>
),
},
}
];
const deleteData = async (id) => {
@@ -331,8 +315,10 @@ export const ProductComponent = observer((props) => {
<Select
mode={"multiple"}
placeholder="Choose Category"
onChange={(val) => {
onChange={async (val) => {
setFilterCategories(val);
store.product.filterByCategory = val;
await store.product.getDataSubCategories();
}}
style={{marginBottom: "20px", width: "100%"}}
>
@@ -353,7 +339,7 @@ export const ProductComponent = observer((props) => {
}}
style={{marginBottom: "20px", width: "100%"}}
>
{store.category.dataSubCategories.map((item) => (
{store.product.dataSubCategories.map((item) => (
<Option value={item.id} key={item.id}>
{item.name}
</Option>