visuddhinanda пре 2 година
родитељ
комит
13d9a53734
1 измењених фајлова са 8 додато и 9 уклоњено
  1. 8 9
      dashboard/src/components/dict/Compound.tsx

+ 8 - 9
dashboard/src/components/dict/Compound.tsx

@@ -58,16 +58,15 @@ const CompoundWidget = ({ word, add, split, onSearch }: IWidget) => {
     if (typeof word === "undefined") {
       return;
     }
-    get<IApiResponseDictList>(`/v2/userdict?view=compound&word=${word}`).then(
-      (json) => {
-        if (json.ok) {
-          const data = json.data.rows.map((item) => {
-            return { value: item.factors, label: item.factors };
-          });
-          setCompound(data);
-        }
+    const url = `/v2/userdict?view=compound&word=${word}&order=confidence`;
+    get<IApiResponseDictList>(url).then((json) => {
+      if (json.ok) {
+        const data = json.data.rows.map((item) => {
+          return { value: item.factors, label: item.factors };
+        });
+        setCompound(data);
       }
-    );
+    });
   }, [word]);
   return (
     <div