visuddhinanda před 3 roky
rodič
revize
24702adb80

+ 2 - 4
dashboard/src/components/corpus/PaliChapterListByTag.tsx

@@ -17,10 +17,8 @@ const Widget = (prop: IWidgetPaliChapterListByTag) => {
     console.log("palichapterlist useEffect");
     console.log("palichapterlist useEffect");
     let url = `/v2/palitext?view=chapter&tags=${prop.tag.join()}`;
     let url = `/v2/palitext?view=chapter&tags=${prop.tag.join()}`;
     console.log("tag url", url);
     console.log("tag url", url);
-    get(url).then(function (myJson) {
-      console.log("ajex", myJson);
-      const data = myJson as unknown as IApiResponsePaliChapterList;
-      let newTree: IPaliChapterData[] = data.data.rows.map((item) => {
+    get<IApiResponsePaliChapterList>(url).then((json) => {
+      let newTree: IPaliChapterData[] = json.data.rows.map((item) => {
         return {
         return {
           Title: item.title,
           Title: item.title,
           PaliTitle: item.title,
           PaliTitle: item.title,