แก้ชื่อresponse

This commit is contained in:
mamoss 2025-05-15 09:30:13 +07:00
parent 03084ca224
commit 320dd4616c

View file

@ -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 });
}
}