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