Explorar o código

fix(user): table reset

Lind %!s(int64=3) %!d(string=hai) anos
pai
achega
b9bfeff9be
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      src/components/SearchComponent/index.tsx

+ 3 - 2
src/components/SearchComponent/index.tsx

@@ -327,8 +327,9 @@ const SearchComponent = <T extends Record<string, any>>({
 
   const resetForm = async () => {
     const temp = initForm;
-    temp.terms1 = temp.terms1.map(() => defaultTerm);
-    temp.terms2 = temp.terms2.map(() => defaultTerm);
+    const expandData = Array(expand ? 1 : 3).fill(defaultTerm);
+    temp.terms1 = expandData;
+    temp.terms2 = expandData;
     setInitParams(temp);
     await form.reset();
     onReset?.();