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 }, });