rename controller
This commit is contained in:
parent
660deeb3a4
commit
6127a594bd
5 changed files with 10 additions and 10 deletions
|
|
@ -33,7 +33,7 @@ import { RequestWithUser } from "../middlewares/user";
|
||||||
@Route("api/v1/org/profile-employee/assessments")
|
@Route("api/v1/org/profile-employee/assessments")
|
||||||
@Tags("ProfileEmployeeAssessments")
|
@Tags("ProfileEmployeeAssessments")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
export class ProfileEmployeeAssessmentsController extends Controller {
|
export class ProfileAssessmentsEmployeeController extends Controller {
|
||||||
private profileEmployeeRepo = AppDataSource.getRepository(ProfileEmployee);
|
private profileEmployeeRepo = AppDataSource.getRepository(ProfileEmployee);
|
||||||
private profileAssessmentsRepository = AppDataSource.getRepository(ProfileAssessment);
|
private profileAssessmentsRepository = AppDataSource.getRepository(ProfileAssessment);
|
||||||
private profileAssessmentsHistoryRepository =
|
private profileAssessmentsHistoryRepository =
|
||||||
|
|
@ -188,7 +188,7 @@ export class ProfileEmployeeAssessmentsController extends Controller {
|
||||||
|
|
||||||
const result = await this.profileAssessmentsRepository.delete({ id: assessmentId });
|
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, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
|
|
@ -28,7 +28,7 @@ import { ProfileEmployee } from "../entities/ProfileEmployee";
|
||||||
@Route("api/v1/org/profile-employee/certificate")
|
@Route("api/v1/org/profile-employee/certificate")
|
||||||
@Tags("ProfileEmployeeCertificate")
|
@Tags("ProfileEmployeeCertificate")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
export class ProfileEmployeeCertificateController extends Controller {
|
export class ProfileCertificateEmployeeController extends Controller {
|
||||||
private profileEmployeeRepo = AppDataSource.getRepository(ProfileEmployee);
|
private profileEmployeeRepo = AppDataSource.getRepository(ProfileEmployee);
|
||||||
private certificateRepo = AppDataSource.getRepository(ProfileCertificate);
|
private certificateRepo = AppDataSource.getRepository(ProfileCertificate);
|
||||||
private certificateHistoryRepo = AppDataSource.getRepository(ProfileCertificateHistory);
|
private certificateHistoryRepo = AppDataSource.getRepository(ProfileCertificateHistory);
|
||||||
|
|
@ -171,7 +171,7 @@ export class ProfileEmployeeCertificateController extends Controller {
|
||||||
id: certificateId,
|
id: certificateId,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (certificateResult.affected && certificateResult.affected <= 0) {
|
if (certificateResult.affected == undefined || certificateResult.affected <= 0) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -24,7 +24,7 @@ import { ProfileEmployee } from "../entities/ProfileEmployee";
|
||||||
@Route("api/v1/org/profile-employee/honor")
|
@Route("api/v1/org/profile-employee/honor")
|
||||||
@Tags("ProfileEmployeeHonor")
|
@Tags("ProfileEmployeeHonor")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
export class ProfileEmployeeHonorController extends Controller {
|
export class ProfileHonorEmployeeController extends Controller {
|
||||||
private profileEmployeeRepo = AppDataSource.getRepository(ProfileEmployee);
|
private profileEmployeeRepo = AppDataSource.getRepository(ProfileEmployee);
|
||||||
private honorRepo = AppDataSource.getRepository(ProfileHonor);
|
private honorRepo = AppDataSource.getRepository(ProfileHonor);
|
||||||
private honorHistoryRepo = AppDataSource.getRepository(ProfileHonorHistory);
|
private honorHistoryRepo = AppDataSource.getRepository(ProfileHonorHistory);
|
||||||
|
|
@ -162,7 +162,7 @@ export class ProfileEmployeeHonorController extends Controller {
|
||||||
|
|
||||||
const result = await this.honorRepo.delete({ id: honorId });
|
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, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@ import { Insignia } from "../entities/Insignia";
|
||||||
@Route("api/v1/org/profile-employee/insignia")
|
@Route("api/v1/org/profile-employee/insignia")
|
||||||
@Tags("ProfileEmployeeInsignia")
|
@Tags("ProfileEmployeeInsignia")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
export class ProfileEmployeeInsigniaController extends Controller {
|
export class ProfileInsigniaEmployeeController extends Controller {
|
||||||
private profileEmployeeRepo = AppDataSource.getRepository(ProfileEmployee);
|
private profileEmployeeRepo = AppDataSource.getRepository(ProfileEmployee);
|
||||||
private insigniaRepo = AppDataSource.getRepository(ProfileInsignia);
|
private insigniaRepo = AppDataSource.getRepository(ProfileInsignia);
|
||||||
private insigniaHistoryRepo = AppDataSource.getRepository(ProfileInsigniaHistory);
|
private insigniaHistoryRepo = AppDataSource.getRepository(ProfileInsigniaHistory);
|
||||||
|
|
@ -220,7 +220,7 @@ export class ProfileEmployeeInsigniaController extends Controller {
|
||||||
|
|
||||||
const result = await this.insigniaRepo.delete({ id: insigniaId });
|
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, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -28,7 +28,7 @@ import { ProfileEmployee } from "../entities/ProfileEmployee";
|
||||||
@Route("api/v1/org/profile-employee/training")
|
@Route("api/v1/org/profile-employee/training")
|
||||||
@Tags("ProfileEmployeeTraining")
|
@Tags("ProfileEmployeeTraining")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
export class ProfileEmployeeTrainingController extends Controller {
|
export class ProfileTrainingEmployeeController extends Controller {
|
||||||
private profileEmployeeRepo = AppDataSource.getRepository(ProfileEmployee);
|
private profileEmployeeRepo = AppDataSource.getRepository(ProfileEmployee);
|
||||||
private trainingRepo = AppDataSource.getRepository(ProfileTraining);
|
private trainingRepo = AppDataSource.getRepository(ProfileTraining);
|
||||||
private trainingHistoryRepo = AppDataSource.getRepository(ProfileTrainingHistory);
|
private trainingHistoryRepo = AppDataSource.getRepository(ProfileTrainingHistory);
|
||||||
|
|
@ -184,7 +184,7 @@ export class ProfileEmployeeTrainingController extends Controller {
|
||||||
|
|
||||||
const result = await this.trainingRepo.delete({ id: trainingId });
|
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, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
}
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue