From 8a36a6c977170eb599c8490737c8bec1e9cd5506 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Wed, 7 Aug 2024 15:08:40 +0700 Subject: [PATCH] get tab7 --- src/controllers/DevelopmentController.ts | 23 +++++++++++++++++++++++ src/entities/Development.ts | 8 ++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/controllers/DevelopmentController.ts b/src/controllers/DevelopmentController.ts index f6f44ef..2e776e3 100644 --- a/src/controllers/DevelopmentController.ts +++ b/src/controllers/DevelopmentController.ts @@ -1410,6 +1410,29 @@ export class DevelopmentController extends Controller { await this.developmentRepository.save(development, { data: request }); return new HttpSuccess(development.id); } + /** + * API รายละเอียดโครงการ/หลักสูตรการฝึกอบรม tab6 + * + * @summary DEV_00 - รายละเอียดโครงการ/หลักสูตรการฝึกอบรมtab6 # + * + * @param {string} id Id โครงการ + */ + @Get("tab7/{id}") + async GetDevelopemtTab7ById(@Path() id: string) { + const getDevelopment = await this.developmentRepository.findOne({ + where: { id }, + }); + const _getDevelopment = { + id: getDevelopment ? getDevelopment.id : null, + accept: getDevelopment ? getDevelopment.accept : null, + receive: getDevelopment ? getDevelopment.receive : null, + approved: getDevelopment ? getDevelopment.approved : null, + budget: getDevelopment ? getDevelopment.budget : null, + budgetSub: getDevelopment ? getDevelopment.budgetSub : null, + budgetPay: getDevelopment ? getDevelopment.budgetPay : null, + }; + return new HttpSuccess(_getDevelopment); + } /** * API แก้ไขโครงการ/หลักสูตรการฝึกอบรม tab8 diff --git a/src/entities/Development.ts b/src/entities/Development.ts index e5bce76..9dab344 100644 --- a/src/entities/Development.ts +++ b/src/entities/Development.ts @@ -821,8 +821,6 @@ export class UpdateDevelopment5 { isOutBudget: boolean; //end @Column() - budgetPay: Double | null; - @Column() expect: string | null; @Column() topicAcademic: string | null; @@ -833,18 +831,20 @@ export class UpdateDevelopment5 { } export class UpdateDevelopment7 { -//move from tab5 + //move from tab5 @Column() budget: string | null; @Column() budgetSub: string | null; @Column() + budgetPay: Double | null; + @Column() accept: Double | null; @Column() receive: Double | null; @Column() approved: Double | null; -//end + //end } export class UpdateDevelopment8 { //move from tab5