From 217354f65319b344df0ee163d21364e6aaae136f Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 6 Aug 2025 10:53:06 +0700 Subject: [PATCH] =?UTF-8?q?api=20=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=A5?= =?UTF-8?q?=E0=B8=B0=E0=B9=80=E0=B8=AD=E0=B8=B5=E0=B8=A2=E0=B8=94=E0=B8=A3?= =?UTF-8?q?=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=9C=E0=B8=A5?= =?UTF-8?q?=E0=B8=87=E0=B8=B2=E0=B8=99=20=E0=B9=83=E0=B8=8A=E0=B9=89.o?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=87=E0=B8=B2=E0=B8=99=20?= =?UTF-8?q?=E0=B8=81.=E0=B8=9E.7/=E0=B8=81.=E0=B8=81.1=20#1642?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/PortfolioController.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/controllers/PortfolioController.ts b/src/controllers/PortfolioController.ts index 294b7f6..eecf28a 100644 --- a/src/controllers/PortfolioController.ts +++ b/src/controllers/PortfolioController.ts @@ -103,6 +103,32 @@ export class PortfolioController extends Controller { return new HttpSuccess(_portfolio); } + /** + * API รายละเอียดรายการผลงาน ใช้แสดงในรายงาน ก.พ.7/ก.ก.1 + * + * @summary รายละเอียดรายการผลงาน ใช้แสดงในรายงาน ก.พ.7/ก.ก.1 + * + */ + @Get("kk1/{keycloak}") + async GetPortfolio(@Path() keycloak: string, @Request() request: RequestWithUser) { + const _portfolio = await this.portfolioRepository.find({ + where: { createdUserId: keycloak }, + select: [ + "name", + "createdAt" + ], + order: { createdAt: "DESC" }, + }); + const result = + _portfolio.map(x => ({ + name: x.name, + year: x.createdAt.getFullYear() > 2500 + ? x.createdAt.getFullYear() + : x.createdAt.getFullYear()+543 + })); + return new HttpSuccess(result); + } + /** * API สร้างรายการ body ผลงาน *