瀏覽代碼

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

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,