From c297572c79ee916f6aa28ef0f34b8873158ab78b Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Thu, 24 Jul 2025 16:58:19 +0700 Subject: [PATCH] fix bug return array org-chart --- src/controllers/OrganizationController.ts | 26 ++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index 2e5af5b9..2a21d9a8 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -4195,19 +4195,21 @@ export class OrganizationController extends Controller { const formattedData_ = rootId === "root" - ? { - personID: "", - name: "", - avatar: "", - positionName: "", - positionNum: "", - positionNumInt: null, - departmentName: data.orgRevisionName, - organizationId: data.id, - children: formattedData, - } + ? [ + { + personID: "", + name: "", + avatar: "", + positionName: "", + positionNum: "", + positionNumInt: null, + departmentName: data.orgRevisionName, + organizationId: data.id, + children: formattedData, + }, + ] : formattedData; - return new HttpSuccess([formattedData_]); + return new HttpSuccess(formattedData_); } /**