소스 검색

提交时去除前端添加的字段

Michael Wang 3 년 전
부모
커밋
877a612dd0
2개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      src/api/inspectPage.ts
  2. 5 0
      src/api/libraryInspectPage.ts

+ 5 - 0
src/api/inspectPage.ts

@@ -118,6 +118,11 @@ export async function rejectInspectedTask(
   studentId: string,
   questionList: Array<Question>
 ) {
+  questionList = JSON.parse(
+    JSON.stringify(questionList, (key, value) =>
+      !key.startsWith("__") ? value : undefined
+    )
+  );
   return httpApp.post("/admin/exam/inspected/rejected", {
     studentId,
     questionList,

+ 5 - 0
src/api/libraryInspectPage.ts

@@ -54,6 +54,11 @@ export async function rejectInspectedTask(
   libraryId: string,
   questionList: Array<Question>
 ) {
+  questionList = JSON.parse(
+    JSON.stringify(questionList, (key, value) =>
+      !key.startsWith("__") ? value : undefined
+    )
+  );
   return httpApp.post("/admin/exam/library/rejected", {
     libraryId,
     questionList,