2
0
Эх сурвалжийг харах

Merge pull request #1925 from visuddhinanda/agile

add log on fetch
visuddhinanda 2 жил өмнө
parent
commit
b53fdc5da9

+ 2 - 2
dashboard/src/components/api/Suggestion.ts

@@ -1,4 +1,4 @@
-import { IUserApiResponse } from "./Auth";
+import { IUser } from "../auth/User";
 import { IChannelApiData } from "./Channel";
 import { IChannelApiData } from "./Channel";
 
 
 export interface ISuggestionData {
 export interface ISuggestionData {
@@ -11,7 +11,7 @@ export interface ISuggestionData {
   channel: IChannelApiData;
   channel: IChannelApiData;
   content: string;
   content: string;
   html: string;
   html: string;
-  editor: IUserApiResponse;
+  editor: IUser;
   created_at: string;
   created_at: string;
   updated_at: string;
   updated_at: string;
 }
 }

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

@@ -63,10 +63,10 @@ const SentHistoryWidget = ({ sentId }: IWidget) => {
         if (typeof params.keyword !== "undefined") {
         if (typeof params.keyword !== "undefined") {
           url += "&search=" + (params.keyword ? params.keyword : "");
           url += "&search=" + (params.keyword ? params.keyword : "");
         }
         }
-        console.info("url", url);
+        console.debug("sentence history list", url);
         const res = await get<ISentHistoryListResponse>(url);
         const res = await get<ISentHistoryListResponse>(url);
         if (res.ok) {
         if (res.ok) {
-          console.debug(res.data);
+          console.debug("sentence history list", res.data);
           const items: ISentHistory[] = res.data.rows.map((item, id) => {
           const items: ISentHistory[] = res.data.rows.map((item, id) => {
             return {
             return {
               content: item.content,
               content: item.content,

+ 20 - 18
dashboard/src/components/course/CourseInfoEdit.tsx

@@ -97,26 +97,28 @@ const CourseInfoEditWidget = ({
             console.debug("upload ", values.cover[0].response);
             console.debug("upload ", values.cover[0].response);
             _cover = values.cover[0].response.data.name;
             _cover = values.cover[0].response.data.name;
           }
           }
-
+          const url = `/v2/course/${courseId}`;
+          const postData = {
+            title: values.title, //标题
+            subtitle: values.subtitle, //副标题
+            summary: values.summary,
+            content: values.content, //简介
+            cover: _cover, //封面图片文件名
+            teacher_id: values.teacherId, //UserID
+            publicity: values.status, //类型-公开/内部
+            anthology_id: values.anthologyId, //文集ID
+            channel_id: values.channelId,
+            start_at: startAt, //课程开始时间
+            end_at: endAt, //课程结束时间
+            join: values.join,
+            request_exp: values.exp,
+          };
+          console.debug("course info edit put", url, postData);
           const res = await put<ICourseDataRequest, ICourseResponse>(
           const res = await put<ICourseDataRequest, ICourseResponse>(
-            `/v2/course/${courseId}`,
-            {
-              title: values.title, //标题
-              subtitle: values.subtitle, //副标题
-              summary: values.summary,
-              content: values.content, //简介
-              cover: _cover, //封面图片文件名
-              teacher_id: values.teacherId, //UserID
-              publicity: values.status, //类型-公开/内部
-              anthology_id: values.anthologyId, //文集ID
-              channel_id: values.channelId,
-              start_at: startAt, //课程开始时间
-              end_at: endAt, //课程结束时间
-              join: values.join,
-              request_exp: values.exp,
-            }
+            url,
+            postData
           );
           );
-          console.log(res);
+          console.debug("course info edit put", res);
           if (res.ok) {
           if (res.ok) {
             message.success(intl.formatMessage({ id: "flashes.success" }));
             message.success(intl.formatMessage({ id: "flashes.success" }));
           } else {
           } else {