zs 3 kuukautta sitten
vanhempi
commit
54ec56a472
1 muutettua tiedostoa jossa 12 lisäystä ja 9 poistoa
  1. 12 9
      src/service/match/matchRegistration.service.ts

+ 12 - 9
src/service/match/matchRegistration.service.ts

@@ -41,23 +41,26 @@ export class MatchRegistrationService extends BaseServiceV2 {
   }
 
   async dealData(data) {
-    const info = get(data, 'info')
+    const info = get(data, 'info');
     if (!info) return data;
-    if (!isArray(data)) return data;
+    if (!isArray(info)) return data;
     // 特化查询: 找出 项目名称 和 负责人补充信息单位
-    const nameList = [{ key: 'project_name', problem: '项目名称' }, { key: 'person_unit', problem: '负责人单位' }]
+    const nameList = [
+      { key: 'project_name', problem: '项目名称' },
+      { key: 'person_unit', problem: '负责人单位' },
+    ];
     for (const i of nameList) {
-      const targetProblem = get(i, 'problem')
+      const targetProblem = get(i, 'problem');
       const problemData = info.find(f => {
-        let problem = get(f, 'problem')
+        let problem = get(f, 'problem');
         // 清除所有空格
         problem = replace(problem, /\s+/g, '');
         return targetProblem === problem;
-      })
+      });
       if (!problemData) continue;
-      const key = get(i, 'key')
-      const reply = get(problemData, 'reply')
-      data[key] = reply
+      const key = get(i, 'key');
+      const reply = get(problemData, 'reply');
+      data[key] = reply;
     }
     return data;
   }