diff --git a/src/controllers/ProfileGovernmentEmployeeController.ts b/src/controllers/ProfileGovernmentEmployeeController.ts index 1e09d6c1..b84718ee 100644 --- a/src/controllers/ProfileGovernmentEmployeeController.ts +++ b/src/controllers/ProfileGovernmentEmployeeController.ts @@ -114,34 +114,34 @@ export class ProfileGovernmentEmployeeController extends Controller { return new HttpSuccess(record); } - /** - * - * @summary เพิ่มข้อมูลราชการ - * - */ - @Post() - public async newGov(@Request() req: RequestWithUser, @Body() body: CreateProfileEmployeeGovernment) { - if (!body.profileEmployeeId) { - throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileEmployeeId"); - } + // /** + // * + // * @summary เพิ่มข้อมูลราชการ + // * + // */ + // @Post() + // public async newGov(@Request() req: RequestWithUser, @Body() body: CreateProfileEmployeeGovernment) { + // if (!body.profileEmployeeId) { + // throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileEmployeeId"); + // } - const profile = await this.profileEmployeeRepo.findOneBy({ id: body.profileEmployeeId }); - if (!profile) { - throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); - } + // const profile = await this.profileEmployeeRepo.findOneBy({ id: body.profileEmployeeId }); + // if (!profile) { + // throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); + // } - const data = new ProfileGovernment(); - const meta = { - createdUserId: req.user.sub, - createdFullName: req.user.name, - lastUpdateUserId: req.user.sub, - lastUpdateFullName: req.user.name, - }; + // const data = new ProfileGovernment(); + // const meta = { + // createdUserId: req.user.sub, + // createdFullName: req.user.name, + // lastUpdateUserId: req.user.sub, + // lastUpdateFullName: req.user.name, + // }; - Object.assign(data, { ...body, ...meta }); - await this.govRepo.save(data); - return new HttpSuccess(); - } + // Object.assign(data, { ...body, ...meta }); + // await this.govRepo.save(data); + // return new HttpSuccess(); + // } /** * @@ -172,17 +172,17 @@ export class ProfileGovernmentEmployeeController extends Controller { return new HttpSuccess(); } - /** - * - * @summary ลบข้อมูลราชการ - * - */ - @Delete("{profileEmployeeId}") - public async deleteGov(@Path() profileEmployeeId: string) { - const result = await this.govRepo.delete({ profileEmployeeId: profileEmployeeId }); - if (result.affected == undefined || result.affected <= 0) { - throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); - } - return new HttpSuccess(); - } + // /** + // * + // * @summary ลบข้อมูลราชการ + // * + // */ + // @Delete("{profileEmployeeId}") + // public async deleteGov(@Path() profileEmployeeId: string) { + // const result = await this.govRepo.delete({ profileEmployeeId: profileEmployeeId }); + // if (result.affected == undefined || result.affected <= 0) { + // throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); + // } + // return new HttpSuccess(); + // } } \ No newline at end of file