diff --git a/src/controllers/BloodGroupController.ts b/src/controllers/BloodGroupController.ts index d407bdb3..5192ac58 100644 --- a/src/controllers/BloodGroupController.ts +++ b/src/controllers/BloodGroupController.ts @@ -28,7 +28,6 @@ import { RequestWithUser } from "../middlewares/user"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class BloodGroupController extends Controller { private bloodGroupRepository = AppDataSource.getRepository(BloodGroup); diff --git a/src/controllers/ChangePositionController.ts b/src/controllers/ChangePositionController.ts index 300d0b69..07d931dd 100644 --- a/src/controllers/ChangePositionController.ts +++ b/src/controllers/ChangePositionController.ts @@ -44,7 +44,6 @@ import CallAPI from "../interfaces/call-api"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class ChangePositionController extends Controller { private changePositionRepository = AppDataSource.getRepository(ChangePosition); private profileChangePositionRepository = AppDataSource.getRepository(ProfileChangePosition); diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 357afdef..ec8ee51e 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -64,7 +64,6 @@ import permission from "../interfaces/permission"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class CommandController extends Controller { private commandRepository = AppDataSource.getRepository(Command); private commandTypeRepository = AppDataSource.getRepository(CommandType); diff --git a/src/controllers/CommandSalaryController.ts b/src/controllers/CommandSalaryController.ts index d2873153..d12e9e29 100644 --- a/src/controllers/CommandSalaryController.ts +++ b/src/controllers/CommandSalaryController.ts @@ -29,7 +29,6 @@ import { CommandSys } from "../entities/CommandSys"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class CommandSalaryController extends Controller { private commandSalaryRepository = AppDataSource.getRepository(CommandSalary); private commandSysRepository = AppDataSource.getRepository(CommandSys); diff --git a/src/controllers/CommandSysController.ts b/src/controllers/CommandSysController.ts index 7c6a8aa1..6bd8e93a 100644 --- a/src/controllers/CommandSysController.ts +++ b/src/controllers/CommandSysController.ts @@ -26,7 +26,6 @@ import { CommandSys, CreateCommandSys, UpdateCommandSys } from "../entities/Comm HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class CommandSysController extends Controller { private commandSysRepository = AppDataSource.getRepository(CommandSys); diff --git a/src/controllers/CommandTypeController.ts b/src/controllers/CommandTypeController.ts index 5884e9eb..839f4766 100644 --- a/src/controllers/CommandTypeController.ts +++ b/src/controllers/CommandTypeController.ts @@ -29,7 +29,6 @@ import { CommandSys } from "../entities/CommandSys"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class CommandTypeController extends Controller { private commandTypeRepository = AppDataSource.getRepository(CommandType); private commandSysRepository = AppDataSource.getRepository(CommandSys); diff --git a/src/controllers/DistrictController.ts b/src/controllers/DistrictController.ts index dc67548c..7fa09dda 100644 --- a/src/controllers/DistrictController.ts +++ b/src/controllers/DistrictController.ts @@ -30,7 +30,6 @@ import { RequestWithUser } from "../middlewares/user"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class DistrictController extends Controller { private districtRepository = AppDataSource.getRepository(District); private provinceRepository = AppDataSource.getRepository(Province); diff --git a/src/controllers/EducationLevelController.ts b/src/controllers/EducationLevelController.ts index bda53464..f9d24458 100644 --- a/src/controllers/EducationLevelController.ts +++ b/src/controllers/EducationLevelController.ts @@ -28,7 +28,6 @@ import { setLogDataDiff } from "../interfaces/utils"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class EducationLevelController extends Controller { private educationLevelRepository = AppDataSource.getRepository(EducationLevel); diff --git a/src/controllers/EmployeePosLevelController.ts b/src/controllers/EmployeePosLevelController.ts index 79d50615..3c8c30b3 100644 --- a/src/controllers/EmployeePosLevelController.ts +++ b/src/controllers/EmployeePosLevelController.ts @@ -33,7 +33,6 @@ import { EmployeePosDict } from "../entities/EmployeePosDict"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class EmployeePosLevelController extends Controller { private employeePosDictRepository = AppDataSource.getRepository(EmployeePosDict); private employeePosTypeRepository = AppDataSource.getRepository(EmployeePosType); diff --git a/src/controllers/EmployeePosTypeController.ts b/src/controllers/EmployeePosTypeController.ts index 7fd73ae1..1fc2d25c 100644 --- a/src/controllers/EmployeePosTypeController.ts +++ b/src/controllers/EmployeePosTypeController.ts @@ -35,7 +35,6 @@ import { setLogDataDiff } from "../interfaces/utils"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class EmployeePosTypeController extends Controller { private employeePosDictRepository = AppDataSource.getRepository(EmployeePosDict); private employeePosTypeRepository = AppDataSource.getRepository(EmployeePosType); @@ -81,8 +80,8 @@ export class EmployeePosTypeController extends Controller { EmpPosType.lastUpdateFullName = request.user.name; EmpPosType.createdAt = new Date(); EmpPosType.lastUpdatedAt = new Date(); - await this.employeePosTypeRepository.save(EmpPosType, {data: request}); - setLogDataDiff(request, {before, after: EmpPosType}); + await this.employeePosTypeRepository.save(EmpPosType, { data: request }); + setLogDataDiff(request, { before, after: EmpPosType }); return new HttpSuccess(EmpPosType.id); } @@ -129,8 +128,8 @@ export class EmployeePosTypeController extends Controller { EmpPosType.lastUpdateFullName = request.user.name; EmpPosType.lastUpdatedAt = new Date(); this.employeePosTypeRepository.merge(EmpPosType, requestBody); - await this.employeePosTypeRepository.save(EmpPosType, {data: request}); - setLogDataDiff(request, {before, after: EmpPosType}); + await this.employeePosTypeRepository.save(EmpPosType, { data: request }); + setLogDataDiff(request, { before, after: EmpPosType }); return new HttpSuccess(EmpPosType.id); } @@ -147,8 +146,8 @@ export class EmployeePosTypeController extends Controller { try { result = await this.employeePosTypeRepository.findOne({ where: { id: id }, - }) - await this.employeePosTypeRepository.remove(result, {data: request}); + }); + await this.employeePosTypeRepository.remove(result, { data: request }); } catch { throw new HttpError( HttpStatusCode.NOT_FOUND, diff --git a/src/controllers/EmployeePositionController.ts b/src/controllers/EmployeePositionController.ts index 3f601929..9a006c2a 100644 --- a/src/controllers/EmployeePositionController.ts +++ b/src/controllers/EmployeePositionController.ts @@ -48,7 +48,6 @@ import { after } from "node:test"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class EmployeePositionController extends Controller { private employeePosDictRepository = AppDataSource.getRepository(EmployeePosDict); private employeePosTypeRepository = AppDataSource.getRepository(EmployeePosType); @@ -169,8 +168,8 @@ export class EmployeePositionController extends Controller { empPosDict.lastUpdateFullName = request.user.name; empPosDict.lastUpdatedAt = new Date(); this.employeePosDictRepository.merge(empPosDict, requestBody); - await this.employeePosDictRepository.save(empPosDict,{data: request}); - setLogDataDiff( request, { before, after: empPosDict }); + await this.employeePosDictRepository.save(empPosDict, { data: request }); + setLogDataDiff(request, { before, after: empPosDict }); return new HttpSuccess(empPosDict.id); } diff --git a/src/controllers/GenderController.ts b/src/controllers/GenderController.ts index 06cc820e..7033aac8 100644 --- a/src/controllers/GenderController.ts +++ b/src/controllers/GenderController.ts @@ -29,7 +29,6 @@ import { RequestWithUser } from "../middlewares/user"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class GenderController extends Controller { private genderRepository = AppDataSource.getRepository(Gender); diff --git a/src/controllers/InsigniaController.ts b/src/controllers/InsigniaController.ts index b85f9d3b..8fce1440 100644 --- a/src/controllers/InsigniaController.ts +++ b/src/controllers/InsigniaController.ts @@ -32,7 +32,6 @@ import { RequestWithUser } from "../middlewares/user"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class InsigniaController extends Controller { private insigniaTypeRepository = AppDataSource.getRepository(InsigniaType); private insigniaRepository = AppDataSource.getRepository(Insignia); diff --git a/src/controllers/InsigniaTypeController.ts b/src/controllers/InsigniaTypeController.ts index 074e0b80..3435bf38 100644 --- a/src/controllers/InsigniaTypeController.ts +++ b/src/controllers/InsigniaTypeController.ts @@ -33,7 +33,6 @@ import { setLogDataDiff } from "../interfaces/utils"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class InsigniaTypeController extends Controller { private insigniaTypeRepository = AppDataSource.getRepository(InsigniaType); private insigniaRepository = AppDataSource.getRepository(Insignia); @@ -110,7 +109,7 @@ export class InsigniaTypeController extends Controller { insigniaType.lastUpdatedAt = new Date(); this.insigniaTypeRepository.merge(insigniaType, requestBody); await this.insigniaTypeRepository.save(insigniaType, { data: request }); - setLogDataDiff( request, { before, after: insigniaType }); + setLogDataDiff(request, { before, after: insigniaType }); return new HttpSuccess(insigniaType.id); } @@ -136,7 +135,7 @@ export class InsigniaTypeController extends Controller { "ไม่สามารถลบได้ เนื่องจากพบข้อมูลที่ตารางเครื่องราชอิสริยาภรณ์", ); } - await this.insigniaTypeRepository.remove(delInsigniaType, {data: request}); + await this.insigniaTypeRepository.remove(delInsigniaType, { data: request }); return new HttpSuccess(); } diff --git a/src/controllers/OrgChild1Controller.ts b/src/controllers/OrgChild1Controller.ts index 8d7399d9..fe6afde7 100644 --- a/src/controllers/OrgChild1Controller.ts +++ b/src/controllers/OrgChild1Controller.ts @@ -39,7 +39,6 @@ import { setLogDataDiff } from "../interfaces/utils"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class OrgChild1Controller { private orgRootRepository = AppDataSource.getRepository(OrgRoot); private child1Repository = AppDataSource.getRepository(OrgChild1); diff --git a/src/controllers/OrgChild2Controller.ts b/src/controllers/OrgChild2Controller.ts index eb71d2df..5f1c450e 100644 --- a/src/controllers/OrgChild2Controller.ts +++ b/src/controllers/OrgChild2Controller.ts @@ -40,7 +40,6 @@ import { setLogDataDiff } from "../interfaces/utils"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class OrgChild2Controller extends Controller { private orgRootRepository = AppDataSource.getRepository(OrgRoot); private child1Repository = AppDataSource.getRepository(OrgChild1); diff --git a/src/controllers/OrgChild3Controller.ts b/src/controllers/OrgChild3Controller.ts index ab7df30b..cc7e505d 100644 --- a/src/controllers/OrgChild3Controller.ts +++ b/src/controllers/OrgChild3Controller.ts @@ -37,7 +37,6 @@ import { setLogDataDiff } from "../interfaces/utils"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class OrgChild3Controller { private orgRootRepository = AppDataSource.getRepository(OrgRoot); private child2Repository = AppDataSource.getRepository(OrgChild2); diff --git a/src/controllers/OrgChild4Controller.ts b/src/controllers/OrgChild4Controller.ts index 1b81b2ae..f6f8b594 100644 --- a/src/controllers/OrgChild4Controller.ts +++ b/src/controllers/OrgChild4Controller.ts @@ -40,7 +40,6 @@ import { setLogDataDiff } from "../interfaces/utils"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class OrgChild4Controller extends Controller { private orgRootRepository = AppDataSource.getRepository(OrgRoot); private child3Repository = AppDataSource.getRepository(OrgChild3); diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index 22ac4164..763a1d3e 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -42,7 +42,6 @@ import { AuthRole } from "../entities/AuthRole"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class OrganizationController extends Controller { private orgRevisionRepository = AppDataSource.getRepository(OrgRevision); private permissionOrgRepository = AppDataSource.getRepository(PermissionOrg); diff --git a/src/controllers/OrganizationUnauthorizeController.ts b/src/controllers/OrganizationUnauthorizeController.ts index 319404d3..0a40e41e 100644 --- a/src/controllers/OrganizationUnauthorizeController.ts +++ b/src/controllers/OrganizationUnauthorizeController.ts @@ -18,7 +18,6 @@ import { ProfileEmployee } from "../entities/ProfileEmployee"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class OrganizationUnauthorizeController extends Controller { private orgRevisionRepository = AppDataSource.getRepository(OrgRevision); private orgRootRepository = AppDataSource.getRepository(OrgRoot); diff --git a/src/controllers/PermissionOrgController.ts b/src/controllers/PermissionOrgController.ts index 4481a8ee..ade79359 100644 --- a/src/controllers/PermissionOrgController.ts +++ b/src/controllers/PermissionOrgController.ts @@ -38,7 +38,6 @@ import { setLogDataDiff } from "../interfaces/utils"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class PermissionOrgController extends Controller { private orgRootRepository = AppDataSource.getRepository(OrgRoot); private profileRepository = AppDataSource.getRepository(Profile); @@ -481,7 +480,7 @@ export class PermissionOrgController extends Controller { _permissionOrg.lastUpdateFullName = request.user.name; _permissionOrg.createdAt = new Date(); _permissionOrg.lastUpdatedAt = new Date(); - await this.permissionOrgRepository.save(_permissionOrg, {data:request}); + await this.permissionOrgRepository.save(_permissionOrg, { data: request }); setLogDataDiff(request, { before, after: _permissionOrg }); return new HttpSuccess(); } @@ -521,7 +520,7 @@ export class PermissionOrgController extends Controller { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบสิทธิ์นี้อยู่ในระบบแล้ว"); } - await this.permissionOrgRepository.remove(_delPermissionOrg, {data:req}); + await this.permissionOrgRepository.remove(_delPermissionOrg, { data: req }); return new HttpSuccess(); } diff --git a/src/controllers/PosExecutiveController.ts b/src/controllers/PosExecutiveController.ts index c7636b62..9a81e3db 100644 --- a/src/controllers/PosExecutiveController.ts +++ b/src/controllers/PosExecutiveController.ts @@ -31,7 +31,6 @@ import { setLogDataDiff } from "../interfaces/utils"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class PosExecutiveController extends Controller { private posExecutiveRepository = AppDataSource.getRepository(PosExecutive); private positionRepository = AppDataSource.getRepository(Position); @@ -85,8 +84,8 @@ export class PosExecutiveController extends Controller { posExecutive.lastUpdateFullName = request.user.name; posExecutive.createdAt = new Date(); posExecutive.lastUpdatedAt = new Date(); - await this.posExecutiveRepository.save(posExecutive, {data: request}); - setLogDataDiff(request, {before, after: posExecutive}); + await this.posExecutiveRepository.save(posExecutive, { data: request }); + setLogDataDiff(request, { before, after: posExecutive }); return new HttpSuccess(posExecutive.id); } @@ -147,8 +146,8 @@ export class PosExecutiveController extends Controller { posExecutive.lastUpdateFullName = request.user.name; posExecutive.lastUpdatedAt = new Date(); // this.posExecutiveRepository.merge(posExecutive, requestBody); - await this.posExecutiveRepository.save(posExecutive, {data: request}); - setLogDataDiff(request, {before, after: posExecutive}); + await this.posExecutiveRepository.save(posExecutive, { data: request }); + setLogDataDiff(request, { before, after: posExecutive }); return new HttpSuccess(); } diff --git a/src/controllers/PosLevelController.ts b/src/controllers/PosLevelController.ts index 8563bc46..df6845ae 100644 --- a/src/controllers/PosLevelController.ts +++ b/src/controllers/PosLevelController.ts @@ -31,7 +31,6 @@ import { Not } from "typeorm"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class PosLevelController extends Controller { private posTypeRepository = AppDataSource.getRepository(PosType); private posLevelRepository = AppDataSource.getRepository(PosLevel); diff --git a/src/controllers/PosMasterActController.ts b/src/controllers/PosMasterActController.ts index ff2d96a6..64ae1c03 100644 --- a/src/controllers/PosMasterActController.ts +++ b/src/controllers/PosMasterActController.ts @@ -30,7 +30,6 @@ import Extension from "../interfaces/extension"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class PosMasterActController extends Controller { private orgRevisionRepository = AppDataSource.getRepository(OrgRevision); private posMasterActRepository = AppDataSource.getRepository(PosMasterAct); diff --git a/src/controllers/PosTypeController.ts b/src/controllers/PosTypeController.ts index bd762af6..62e0d73b 100644 --- a/src/controllers/PosTypeController.ts +++ b/src/controllers/PosTypeController.ts @@ -33,7 +33,6 @@ import { RequestWithUser } from "../middlewares/user"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class PosTypeController extends Controller { private posTypeRepository = AppDataSource.getRepository(PosType); private posLevelRepository = AppDataSource.getRepository(PosLevel); @@ -73,8 +72,8 @@ export class PosTypeController extends Controller { posType.lastUpdateFullName = request.user.name; posType.createdAt = new Date(); posType.lastUpdatedAt = new Date(); - await this.posTypeRepository.save(posType, {data: request}); - setLogDataDiff(request, {before , after: posType}); + await this.posTypeRepository.save(posType, { data: request }); + setLogDataDiff(request, { before, after: posType }); return new HttpSuccess(posType); } @@ -113,8 +112,8 @@ export class PosTypeController extends Controller { posType.lastUpdateFullName = request.user.name; posType.lastUpdatedAt = new Date(); this.posTypeRepository.merge(posType, requestBody); - await this.posTypeRepository.save(posType, {data: request}); - setLogDataDiff(request,{ before, after:posType }); + await this.posTypeRepository.save(posType, { data: request }); + setLogDataDiff(request, { before, after: posType }); return new HttpSuccess(posType.id); } @@ -130,10 +129,10 @@ export class PosTypeController extends Controller { let result: any; try { result = await this.posTypeRepository.findOne({ where: { id } }); - if(!result){ + if (!result) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลประเภทตำแหน่งนี้"); } - await this.posTypeRepository.remove(result, {data: result}); + await this.posTypeRepository.remove(result, { data: result }); } catch { throw new HttpError( HttpStatusCode.NOT_FOUND, diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index 9608bca7..833da9f6 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -52,7 +52,6 @@ import { Assign } from "../entities/Assign"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class PositionController extends Controller { private posExecutiveRepository = AppDataSource.getRepository(PosExecutive); private posTypeRepository = AppDataSource.getRepository(PosType); diff --git a/src/controllers/PrefixController.ts b/src/controllers/PrefixController.ts index 92f6f96a..5d3d5fa6 100644 --- a/src/controllers/PrefixController.ts +++ b/src/controllers/PrefixController.ts @@ -30,7 +30,6 @@ import { request } from "axios"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class PrefixController extends Controller { private prefixRepository = AppDataSource.getRepository(Prefixe); diff --git a/src/controllers/ProvinceController.ts b/src/controllers/ProvinceController.ts index 92169272..24142a45 100644 --- a/src/controllers/ProvinceController.ts +++ b/src/controllers/ProvinceController.ts @@ -29,7 +29,6 @@ import { RequestWithUser } from "../middlewares/user"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class ProvinceController extends Controller { private provinceRepository = AppDataSource.getRepository(Province); diff --git a/src/controllers/RankController.ts b/src/controllers/RankController.ts index c5b0e6cb..adc8fe6f 100644 --- a/src/controllers/RankController.ts +++ b/src/controllers/RankController.ts @@ -28,7 +28,6 @@ import { RequestWithUser } from "../middlewares/user"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class RankController extends Controller { private rankRepository = AppDataSource.getRepository(Rank); diff --git a/src/controllers/RelationshipController.ts b/src/controllers/RelationshipController.ts index 1dd9ff5c..2c3da7d8 100644 --- a/src/controllers/RelationshipController.ts +++ b/src/controllers/RelationshipController.ts @@ -29,7 +29,6 @@ import { request } from "axios"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class RelationshipController extends Controller { private relationshipRepository = AppDataSource.getRepository(Relationship); diff --git a/src/controllers/ReligionController.ts b/src/controllers/ReligionController.ts index dfd3b98d..624ed6f5 100644 --- a/src/controllers/ReligionController.ts +++ b/src/controllers/ReligionController.ts @@ -28,7 +28,6 @@ import { RequestWithUser } from "../middlewares/user"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class ReligionController extends Controller { private religionRepository = AppDataSource.getRepository(Religion); diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 92e3a778..65cdc21d 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -18,7 +18,6 @@ import Extension from "../interfaces/extension"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class ReportController extends Controller { private orgRevisionRepository = AppDataSource.getRepository(OrgRevision); private orgRootRepository = AppDataSource.getRepository(OrgRoot); diff --git a/src/controllers/SubDistrictController.ts b/src/controllers/SubDistrictController.ts index d503a695..2e212fc9 100644 --- a/src/controllers/SubDistrictController.ts +++ b/src/controllers/SubDistrictController.ts @@ -30,7 +30,6 @@ import { setLogDataDiff } from "../interfaces/utils"; HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง", ) -@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") export class SubDistrictController extends Controller { private subDistrictRepository = AppDataSource.getRepository(SubDistrict); private districtRepository = AppDataSource.getRepository(District);