From 1bccf8f87d30e407c3be19b5ea60f2bf7e9cc394 Mon Sep 17 00:00:00 2001 From: kittapath Date: Wed, 2 Oct 2024 11:12:28 +0700 Subject: [PATCH] no message --- src/controllers/CommandController.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index efccce68..d2eaa73f 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -877,6 +877,9 @@ export class CommandController extends Controller { commandNo: command.commandNo, commandYear: command.commandYear, templateDoc: command.positionDetail, + amount: x.amount, + positionSalaryAmount: x.positionSalaryAmount, + mouthSalaryAmount: x.mouthSalaryAmount, })), }) .then(async (res) => {}) @@ -982,7 +985,7 @@ export class CommandController extends Controller { async PostPerson( @Body() requestBody: { - commandTypeId?: string; + commandTypeId?: string | null; commandNo?: string | null; commandYear?: number | null; commandId?: string | null; @@ -1019,6 +1022,9 @@ export class CommandController extends Controller { command = _command; } else { command = Object.assign(new Command(), requestBody); + if (!requestBody.commandTypeId) { + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบประเภทคำสั่ง"); + } const commandType = await this.commandTypeRepository.findOne({ where: { id: requestBody.commandTypeId }, });