Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop
This commit is contained in:
commit
970ae04afd
6 changed files with 30 additions and 27 deletions
|
|
@ -66,12 +66,12 @@ export class ProfileAbilityController extends Controller {
|
||||||
@Path() abilityId: string,
|
@Path() abilityId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
const _record = await this.profileAbilityRepo.findOne({
|
// const _record = await this.profileAbilityRepo.findOne({
|
||||||
where: { id: abilityId },
|
// where: { id: abilityId },
|
||||||
});
|
// });
|
||||||
if (_record) {
|
// if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
// }
|
||||||
const record = await this.profileAbilityHistoryRepo.find({
|
const record = await this.profileAbilityHistoryRepo.find({
|
||||||
where: { profileAbilityId: abilityId },
|
where: { profileAbilityId: abilityId },
|
||||||
order: { createdAt: "DESC" },
|
order: { createdAt: "DESC" },
|
||||||
|
|
|
||||||
|
|
@ -70,11 +70,6 @@ export class ProfileAssessmentsController extends Controller {
|
||||||
@Path() assessmentId: string,
|
@Path() assessmentId: string,
|
||||||
@Request() req: RequestWithUser,
|
@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({
|
const record = await this.profileAssessmentsHistoryRepository.find({
|
||||||
where: {
|
where: {
|
||||||
profileAssessmentId: assessmentId,
|
profileAssessmentId: assessmentId,
|
||||||
|
|
@ -85,6 +80,14 @@ export class ProfileAssessmentsController extends Controller {
|
||||||
if (!record) {
|
if (!record) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
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);
|
||||||
|
// }
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,10 +57,10 @@ export class ProfileCertificateController extends Controller {
|
||||||
|
|
||||||
@Get("history/{certificateId}")
|
@Get("history/{certificateId}")
|
||||||
public async certificateHistory(@Path() certificateId: string, @Request() req: RequestWithUser) {
|
public async certificateHistory(@Path() certificateId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.certificateRepo.findOneBy({ id: certificateId });
|
// const _record = await this.certificateRepo.findOneBy({ id: certificateId });
|
||||||
if (_record) {
|
// if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
// }
|
||||||
const record = await this.certificateHistoryRepo.find({
|
const record = await this.certificateHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
profileCertificateId: certificateId,
|
profileCertificateId: certificateId,
|
||||||
|
|
|
||||||
|
|
@ -68,10 +68,10 @@ export class ProfileEducationsController extends Controller {
|
||||||
@Path() educationId: string,
|
@Path() educationId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
const _record = await this.profileEducationRepo.findOneBy({ id: educationId });
|
// const _record = await this.profileEducationRepo.findOneBy({ id: educationId });
|
||||||
if (_record) {
|
// if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
// }
|
||||||
const record = await this.profileEducationHistoryRepo.find({
|
const record = await this.profileEducationHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
profileEducationId: educationId,
|
profileEducationId: educationId,
|
||||||
|
|
|
||||||
|
|
@ -54,10 +54,10 @@ export class ProfileOtherController extends Controller {
|
||||||
|
|
||||||
@Get("history/{otherId}")
|
@Get("history/{otherId}")
|
||||||
public async otherHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
|
public async otherHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.otherRepository.findOneBy({ id: otherId });
|
// const _record = await this.otherRepository.findOneBy({ id: otherId });
|
||||||
if (_record) {
|
// if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
// }
|
||||||
const record = await this.otherHistoryRepository.find({
|
const record = await this.otherHistoryRepository.find({
|
||||||
where: { profileOtherId: otherId },
|
where: { profileOtherId: otherId },
|
||||||
order: { createdAt: "DESC" },
|
order: { createdAt: "DESC" },
|
||||||
|
|
|
||||||
|
|
@ -65,10 +65,10 @@ export class ProfileSalaryController extends Controller {
|
||||||
|
|
||||||
@Get("history/{salaryId}")
|
@Get("history/{salaryId}")
|
||||||
public async salaryHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
|
public async salaryHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.salaryRepo.findOneBy({ id: salaryId });
|
// const _record = await this.salaryRepo.findOneBy({ id: salaryId });
|
||||||
if (_record) {
|
// if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
// }
|
||||||
const record = await this.salaryHistoryRepo.find({
|
const record = await this.salaryHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
profileSalaryId: salaryId,
|
profileSalaryId: salaryId,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue