diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 8046056a..04de1aef 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -3012,6 +3012,29 @@ export class CommandController extends Controller { return new HttpSuccess(_data); } + /** + * API อัพเดทสถานะ CANCEL คำสั่งยกเลิกการลาออก, คำสั่งยกเลิกการลาออกลูกจ้าง + * + * @summary API อัพเดทสถานะ CANCEL คำสั่งยกเลิกการลาออก, คำสั่งยกเลิกการลาออกลูกจ้าง + * + */ + @Post("cancel-resign") + public async command41Excecute( + @Request() req: RequestWithUser, + @Body() + body: { + commandId: string[]; + }, + ) { + const commands = await this.commandRepository.find({ where: { id: In(body.commandId) } }); + const data = commands.map((_data) => ({ + ..._data, + status: "CANCEL", + })); + await this.commandRepository.save(data); + return new HttpSuccess(); + } + @Post("excexute/salary-current") public async newSalaryAndUpdateCurrent( @Request() req: RequestWithUser,