From 1590a08e1b476327530367a5c78e68e29ddecd85 Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 6 Aug 2025 11:39:13 +0700 Subject: [PATCH] update issue #1642 --- src/controllers/ProfileController.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index e75e7878..49fbb1cd 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -1684,15 +1684,23 @@ export class ProfileController extends Controller { ) : ""; - let portfolio:any + let portfolios:any await new CallAPI() .GetData(req, `/development/portfolio/kk1/${profiles?.keycloak}`) .then((x) => { - portfolio = x.result; + portfolios = x; }) .catch(() => {}); - if (!portfolio) - portfolio = [{name: "-", year: "-"}] + if (!portfolios) { + portfolios = [{ name: "-", year: "-" }] + } + else { + portfolios = portfolios.map((x:any) => ({ + name: x.name ? x.name : "-", + year: x.year ? Extension.ToThaiNumber(x.year.toString()) : "-" + })) + } + const data = { fullName: `${profiles?.prefix}${profiles?.firstName} ${profiles?.lastName}`, @@ -1847,7 +1855,7 @@ export class ProfileController extends Controller { assessments, profileAbility, otherIncome, - portfolio + portfolios }; return new HttpSuccess({