rename controller

This commit is contained in:
Bright 2024-05-13 17:59:11 +07:00
parent 660deeb3a4
commit 6127a594bd
5 changed files with 10 additions and 10 deletions

View file

@ -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();

View file

@ -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, "ไม่พบข้อมูล");
}

View file

@ -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, "ไม่พบข้อมูล");
}

View file

@ -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, "ไม่พบข้อมูล");
}

View file

@ -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, "ไม่พบข้อมูล");
}