diff --git a/src/controllers/WorkflowController.ts b/src/controllers/WorkflowController.ts index c9190cf9..921c4184 100644 --- a/src/controllers/WorkflowController.ts +++ b/src/controllers/WorkflowController.ts @@ -1296,13 +1296,13 @@ export class WorkflowController extends Controller { .skip((body.page - 1) * body.pageSize) .take(body.pageSize) .getManyAndCount(); - lists.map((x) => ({ + const data = lists.map((x) => ({ ...x, posExecutiveNameOrg: x.posExecutiveName + (x.orgChild4 ?? x.orgChild3 ?? x.orgChild2 ?? x.orgChild1 ?? x.orgRoot ?? ""), })); - return new HttpSuccess({ data: lists, total }); + return new HttpSuccess({ data: data, total }); } else { const [lists, total] = await AppDataSource.getRepository(viewDirector) .createQueryBuilder("viewDirector") @@ -1374,13 +1374,13 @@ export class WorkflowController extends Controller { .skip((body.page - 1) * body.pageSize) .take(body.pageSize) .getManyAndCount(); - lists.map((x) => ({ + const data = lists.map((x) => ({ ...x, posExecutiveNameOrg: x.posExecutiveName + (x.orgChild4 ?? x.orgChild3 ?? x.orgChild2 ?? x.orgChild1 ?? x.orgRoot ?? ""), })); - return new HttpSuccess({ data: lists, total }); + return new HttpSuccess({ data: data, total }); } }