diff --git a/src/controllers/ProfileEmployeeAssessmentsController.ts b/src/controllers/ProfileAssessmentsEmployeeController.ts similarity index 98% rename from src/controllers/ProfileEmployeeAssessmentsController.ts rename to src/controllers/ProfileAssessmentsEmployeeController.ts index 3862b106..4f65867d 100644 --- a/src/controllers/ProfileEmployeeAssessmentsController.ts +++ b/src/controllers/ProfileAssessmentsEmployeeController.ts @@ -33,7 +33,7 @@ import { RequestWithUser } from "../middlewares/user"; @Route("api/v1/org/profile-employee/assessments") @Tags("ProfileEmployeeAssessments") @Security("bearerAuth") -export class ProfileEmployeeAssessmentsController extends Controller { +export class ProfileAssessmentsEmployeeController extends Controller { private profileEmployeeRepo = AppDataSource.getRepository(ProfileEmployee); private profileAssessmentsRepository = AppDataSource.getRepository(ProfileAssessment); private profileAssessmentsHistoryRepository = @@ -188,7 +188,7 @@ export class ProfileEmployeeAssessmentsController extends Controller { const result = await this.profileAssessmentsRepository.delete({ id: assessmentId }); - if (result.affected && result.affected <= 0) + if (result.affected == undefined || result.affected <= 0) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); return new HttpSuccess(); diff --git a/src/controllers/ProfileEmployeeCertificateController.ts b/src/controllers/ProfileCertificateEmployeeController.ts similarity index 97% rename from src/controllers/ProfileEmployeeCertificateController.ts rename to src/controllers/ProfileCertificateEmployeeController.ts index 03d05af9..255d38af 100644 --- a/src/controllers/ProfileEmployeeCertificateController.ts +++ b/src/controllers/ProfileCertificateEmployeeController.ts @@ -28,7 +28,7 @@ import { ProfileEmployee } from "../entities/ProfileEmployee"; @Route("api/v1/org/profile-employee/certificate") @Tags("ProfileEmployeeCertificate") @Security("bearerAuth") -export class ProfileEmployeeCertificateController extends Controller { +export class ProfileCertificateEmployeeController extends Controller { private profileEmployeeRepo = AppDataSource.getRepository(ProfileEmployee); private certificateRepo = AppDataSource.getRepository(ProfileCertificate); private certificateHistoryRepo = AppDataSource.getRepository(ProfileCertificateHistory); @@ -171,7 +171,7 @@ export class ProfileEmployeeCertificateController extends Controller { id: certificateId, }); - if (certificateResult.affected && certificateResult.affected <= 0) { + if (certificateResult.affected == undefined || certificateResult.affected <= 0) { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); } diff --git a/src/controllers/ProfileEmployeeHonorController.ts b/src/controllers/ProfileHonorEmployeeController.ts similarity index 97% rename from src/controllers/ProfileEmployeeHonorController.ts rename to src/controllers/ProfileHonorEmployeeController.ts index 77728751..44157de8 100644 --- a/src/controllers/ProfileEmployeeHonorController.ts +++ b/src/controllers/ProfileHonorEmployeeController.ts @@ -24,7 +24,7 @@ import { ProfileEmployee } from "../entities/ProfileEmployee"; @Route("api/v1/org/profile-employee/honor") @Tags("ProfileEmployeeHonor") @Security("bearerAuth") -export class ProfileEmployeeHonorController extends Controller { +export class ProfileHonorEmployeeController extends Controller { private profileEmployeeRepo = AppDataSource.getRepository(ProfileEmployee); private honorRepo = AppDataSource.getRepository(ProfileHonor); private honorHistoryRepo = AppDataSource.getRepository(ProfileHonorHistory); @@ -162,7 +162,7 @@ export class ProfileEmployeeHonorController extends Controller { const result = await this.honorRepo.delete({ id: honorId }); - if (result.affected && result.affected <= 0) { + if (result.affected == undefined || result.affected <= 0) { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); } diff --git a/src/controllers/ProfileEmployeeInsigniaController.ts b/src/controllers/ProfileInsigniaEmployeeController.ts similarity index 98% rename from src/controllers/ProfileEmployeeInsigniaController.ts rename to src/controllers/ProfileInsigniaEmployeeController.ts index c4340606..4089c8a1 100644 --- a/src/controllers/ProfileEmployeeInsigniaController.ts +++ b/src/controllers/ProfileInsigniaEmployeeController.ts @@ -29,7 +29,7 @@ import { Insignia } from "../entities/Insignia"; @Route("api/v1/org/profile-employee/insignia") @Tags("ProfileEmployeeInsignia") @Security("bearerAuth") -export class ProfileEmployeeInsigniaController extends Controller { +export class ProfileInsigniaEmployeeController extends Controller { private profileEmployeeRepo = AppDataSource.getRepository(ProfileEmployee); private insigniaRepo = AppDataSource.getRepository(ProfileInsignia); private insigniaHistoryRepo = AppDataSource.getRepository(ProfileInsigniaHistory); @@ -220,7 +220,7 @@ export class ProfileEmployeeInsigniaController extends Controller { const result = await this.insigniaRepo.delete({ id: insigniaId }); - if (result.affected && result.affected <= 0) { + if (result.affected == undefined || result.affected <= 0) { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); } diff --git a/src/controllers/ProfileEmployeeTrainingController.ts b/src/controllers/ProfileTrainingEmployeeController.ts similarity index 97% rename from src/controllers/ProfileEmployeeTrainingController.ts rename to src/controllers/ProfileTrainingEmployeeController.ts index 662e0708..8e8c76d4 100644 --- a/src/controllers/ProfileEmployeeTrainingController.ts +++ b/src/controllers/ProfileTrainingEmployeeController.ts @@ -28,7 +28,7 @@ import { ProfileEmployee } from "../entities/ProfileEmployee"; @Route("api/v1/org/profile-employee/training") @Tags("ProfileEmployeeTraining") @Security("bearerAuth") -export class ProfileEmployeeTrainingController extends Controller { +export class ProfileTrainingEmployeeController extends Controller { private profileEmployeeRepo = AppDataSource.getRepository(ProfileEmployee); private trainingRepo = AppDataSource.getRepository(ProfileTraining); private trainingHistoryRepo = AppDataSource.getRepository(ProfileTrainingHistory); @@ -184,7 +184,7 @@ export class ProfileEmployeeTrainingController extends Controller { const result = await this.trainingRepo.delete({ id: trainingId }); - if (result.affected && result.affected <= 0) { + if (result.affected == undefined || result.affected <= 0) { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); }