From 61176e05951ba3224c0ae0d3f7622830944184b5 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Mon, 2 Sep 2024 11:03:54 +0700 Subject: [PATCH 1/2] =?UTF-8?q?=E0=B8=9B=E0=B8=B4=E0=B8=94=E0=B8=AA?= =?UTF-8?q?=E0=B8=B4=E0=B8=97=E0=B8=98=E0=B8=B4=E0=B9=8C=20history=20?= =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5=E0=B8=A2=E0=B8=99?= =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B7?= =?UTF-8?q?=20(=E0=B8=8A=E0=B8=99=20USER)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ProfileAbilityController.ts | 12 ++++++------ src/controllers/ProfileAssessmentsController.ts | 16 ++++++++-------- src/controllers/ProfileCertificateController.ts | 8 ++++---- src/controllers/ProfileEducationsController.ts | 8 ++++---- src/controllers/ProfileOtherController.ts | 8 ++++---- src/controllers/ProfileSalaryController.ts | 8 ++++---- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/controllers/ProfileAbilityController.ts b/src/controllers/ProfileAbilityController.ts index 7610f058..7c889bed 100644 --- a/src/controllers/ProfileAbilityController.ts +++ b/src/controllers/ProfileAbilityController.ts @@ -123,12 +123,12 @@ export class ProfileAbilityController extends Controller { @Path() abilityId: string, @Request() req: RequestWithUser, ) { - const _record = await this.profileAbilityRepo.findOne({ - where: { id: abilityId }, - }); - if (_record) { - await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); - } + // const _record = await this.profileAbilityRepo.findOne({ + // where: { id: abilityId }, + // }); + // if (_record) { + // await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); + // } const record = await this.profileAbilityHistoryRepo.find({ relations: ["histories"], where: { profileAbilityId: abilityId }, diff --git a/src/controllers/ProfileAssessmentsController.ts b/src/controllers/ProfileAssessmentsController.ts index 316b76eb..53c3a321 100644 --- a/src/controllers/ProfileAssessmentsController.ts +++ b/src/controllers/ProfileAssessmentsController.ts @@ -144,14 +144,14 @@ export class ProfileAssessmentsController extends Controller { if (!record) { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); } - const _record = await this.profileAssessmentsRepository.findOne({ - where: { - id: assessmentId, - }, - }); - if (_record) { - await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); - } + // const _record = await this.profileAssessmentsRepository.findOne({ + // where: { + // id: assessmentId, + // }, + // }); + // if (_record) { + // await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); + // } return new HttpSuccess(record); } diff --git a/src/controllers/ProfileCertificateController.ts b/src/controllers/ProfileCertificateController.ts index 76499740..7aa4140b 100644 --- a/src/controllers/ProfileCertificateController.ts +++ b/src/controllers/ProfileCertificateController.ts @@ -111,10 +111,10 @@ export class ProfileCertificateController extends Controller { ], }) public async certificateHistory(@Path() certificateId: string, @Request() req: RequestWithUser) { - const _record = await this.certificateRepo.findOneBy({ id: certificateId }); - if (_record) { - await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); - } + // const _record = await this.certificateRepo.findOneBy({ id: certificateId }); + // if (_record) { + // await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); + // } const record = await this.certificateHistoryRepo.findBy({ profileCertificateId: certificateId, }); diff --git a/src/controllers/ProfileEducationsController.ts b/src/controllers/ProfileEducationsController.ts index bf81e0fd..0d276398 100644 --- a/src/controllers/ProfileEducationsController.ts +++ b/src/controllers/ProfileEducationsController.ts @@ -168,10 +168,10 @@ export class ProfileEducationsController extends Controller { ], }) public async getProfileEducationHistory(@Path() educationId: string, @Request() req: RequestWithUser) { - const _record = await this.profileEducationRepo.findOneBy({ id: educationId }); - if (_record) { - await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); - } + // const _record = await this.profileEducationRepo.findOneBy({ id: educationId }); + // if (_record) { + // await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); + // } const record = await this.profileEducationHistoryRepo.findBy({ profileEducationId: educationId, }); diff --git a/src/controllers/ProfileOtherController.ts b/src/controllers/ProfileOtherController.ts index a457f029..689df047 100644 --- a/src/controllers/ProfileOtherController.ts +++ b/src/controllers/ProfileOtherController.ts @@ -85,10 +85,10 @@ export class ProfileOtherController extends Controller { ], }) public async otherHistory(@Path() otherId: string, @Request() req: RequestWithUser) { - const _record = await this.otherRepository.findOneBy({ id: otherId }); - if (_record) { - await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); - } + // const _record = await this.otherRepository.findOneBy({ id: otherId }); + // if (_record) { + // await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); + // } const record = await this.otherHistoryRepository.find({ where: { profileOtherId: otherId }, order: { createdAt: "DESC" }, diff --git a/src/controllers/ProfileSalaryController.ts b/src/controllers/ProfileSalaryController.ts index 48bbdac3..f87ba460 100644 --- a/src/controllers/ProfileSalaryController.ts +++ b/src/controllers/ProfileSalaryController.ts @@ -143,10 +143,10 @@ export class ProfileSalaryController extends Controller { ], }) public async salaryHistory(@Path() salaryId: string, @Request() req: RequestWithUser) { - const _record = await this.salaryRepo.findOneBy({ id: salaryId }); - if (_record) { - await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); - } + // const _record = await this.salaryRepo.findOneBy({ id: salaryId }); + // if (_record) { + // await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); + // } const record = await this.salaryHistoryRepo.findBy({ profileSalaryId: salaryId, }); From a7c1b2e6a9da7e757cc80b3d22edb7cb655aa902 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Mon, 2 Sep 2024 11:23:22 +0700 Subject: [PATCH 2/2] fix --- src/controllers/ProfileAssessmentsController.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/controllers/ProfileAssessmentsController.ts b/src/controllers/ProfileAssessmentsController.ts index 59301b74..314250c7 100644 --- a/src/controllers/ProfileAssessmentsController.ts +++ b/src/controllers/ProfileAssessmentsController.ts @@ -70,11 +70,6 @@ export class ProfileAssessmentsController extends Controller { @Path() assessmentId: string, @Request() req: RequestWithUser, ) { - const _record = await this.profileAssessmentsRepository.findOneBy({ - id: assessmentId, - }); - if (_record) - await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); const record = await this.profileAssessmentsHistoryRepository.find({ where: { profileAssessmentId: assessmentId,