fix: change category not default select sub categories
This commit is contained in:
parent
9cefac57ae
commit
a89566adc1
|
@ -69,14 +69,11 @@ export const Product = observer(() => {
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Select
|
<Select
|
||||||
placeholder={"Select Sub Category"}
|
placeholder={"Select Sub Category"}
|
||||||
allowClear={true}
|
allowClear={true}
|
||||||
onChange={(val) => {
|
onChange={(val) => handleChangeSubcategory(val)}
|
||||||
if (val) {
|
style={{marginBottom: "10px", width: "100%"}}
|
||||||
handleChangeSubcategory(val);
|
value={store.transaction.filterSubCategory}
|
||||||
}
|
|
||||||
}}
|
|
||||||
style={{marginBottom: "10px", width: "100%"}}
|
|
||||||
>
|
>
|
||||||
{store.transaction.dataSubCategories.map((item, index) => (
|
{store.transaction.dataSubCategories.map((item, index) => (
|
||||||
<Option key={item.id} value={item.id}>
|
<Option key={item.id} value={item.id}>
|
||||||
|
|
|
@ -34,9 +34,10 @@ export const Transaction = observer(() => {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleChangeTabs = async (key) => {
|
const handleChangeTabs = async (key) => {
|
||||||
|
modalLoader.setLoading(true);
|
||||||
store.transaction.dataSubCategories = [];
|
store.transaction.dataSubCategories = [];
|
||||||
store.transaction.data = [];
|
store.transaction.data = [];
|
||||||
modalLoader.setLoading(true);
|
store.transaction.filterSubCategory = null;
|
||||||
store.transaction.filterCategory = key;
|
store.transaction.filterCategory = key;
|
||||||
await store.transaction.getDataSubCategories();
|
await store.transaction.getDataSubCategories();
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user