Quellcode durchsuchen

改拼写错误 Response

visuddhinanda vor 3 Jahren
Ursprung
Commit
2dae7b310b

+ 17 - 3
dashboard/src/components/api/Corpus.ts

@@ -17,18 +17,18 @@ export interface IApiPaliChapterList {
   path: string;
 }
 
-export interface IApiResponcePaliChapterList {
+export interface IApiResponsePaliChapterList {
   ok: boolean;
   message: string;
   data: { rows: IApiPaliChapterList[]; count: number };
 }
-export interface IApiResponcePaliChapter {
+export interface IApiResponsePaliChapter {
   ok: boolean;
   message: string;
   data: IApiPaliChapterList;
 }
 
-export interface IApiResponcePaliPara {
+export interface IApiResponsePaliPara {
   book: number;
   paragraph: number;
   level: number;
@@ -138,3 +138,17 @@ export interface ISentenceResponse {
   message: string;
   data: ISentenceData;
 }
+
+export interface IPaliToc {
+  book: number;
+  paragraph: number;
+  level: string;
+  toc: string;
+  translation?: string;
+}
+
+export interface IPaliTocListResponse {
+  ok: boolean;
+  message: string;
+  data: { rows: IPaliToc[]; count: number };
+}

+ 2 - 2
dashboard/src/components/corpus/PaliChapterHead.tsx

@@ -3,7 +3,7 @@ import { message } from "antd";
 import ChapterHead, { IChapterInfo } from "./ChapterHead";
 import { IParagraph } from "./BookViewer";
 import TocPath, { ITocPathNode } from "./TocPath";
-import { IApiResponcePaliChapter } from "../api/Corpus";
+import { IApiResponsePaliChapter } from "../api/Corpus";
 import { get } from "../../request";
 
 interface IWidgetPaliChapterHead {
@@ -30,7 +30,7 @@ const Widget = (prop: IWidgetPaliChapterHead) => {
 
   function fetchData(para: IParagraph) {
     let url = `/v2/palitext?view=paragraph&book=${para.book}&para=${para.para}`;
-    get<IApiResponcePaliChapter>(url).then(function (myJson) {
+    get<IApiResponsePaliChapter>(url).then(function (myJson) {
       console.log("ajex", myJson);
       const data = myJson;
       let path: ITocPathNode[] = JSON.parse(data.data.path);