@esvndev/es-react-config-setting 1.0.42 → 1.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -11544,7 +11544,7 @@ const SettingApp = (props) => {
11544
11544
  if (data.status) {
11545
11545
  setDataSettingGroup(data.data);
11546
11546
  setTimeout(() => {
11547
- switchSettingTab(data.data[0]);
11547
+ loadSettingConfigByGroup(data.data);
11548
11548
  }, 500);
11549
11549
  }
11550
11550
  else {
@@ -11553,12 +11553,8 @@ const SettingApp = (props) => {
11553
11553
  });
11554
11554
  }
11555
11555
  }, [isOpen]);
11556
- //Sự kiện chọn nhóm cài đặt
11557
- const switchSettingTab = (data) => {
11558
- const updated = dataSettingGroup.map((item) => ({
11559
- ...item,
11560
- active: item.id === data.id
11561
- }));
11556
+ //Lấy danh sách cài đặt theo nhóm đã chọn
11557
+ const loadSettingConfigByGroup = (data) => {
11562
11558
  GetSettingConfigByGroup({ GroupId: data.id }, (rs) => {
11563
11559
  if (rs.status) {
11564
11560
  setSettingData(rs.data);
@@ -11567,6 +11563,14 @@ const SettingApp = (props) => {
11567
11563
  setSettingData([]);
11568
11564
  }
11569
11565
  });
11566
+ };
11567
+ //Sự kiện chọn nhóm cài đặt
11568
+ const switchSettingTab = (data) => {
11569
+ const updated = dataSettingGroup.map((item) => ({
11570
+ ...item,
11571
+ active: item.id === data.id
11572
+ }));
11573
+ loadSettingConfigByGroup(data);
11570
11574
  setDataSettingGroup(updated);
11571
11575
  };
11572
11576
  //Hàm sử dụng tạo theo loại giá trị