fix
This commit is contained in:
parent
8b1543342c
commit
281c5c7dfd
2 changed files with 41 additions and 41 deletions
|
|
@ -2893,7 +2893,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
@Path() profileEmployeeId: string,
|
||||
@Body() body: UpdateInformationProfileEmployee,
|
||||
) {
|
||||
// await new permission().PermissionOrgUserUpdate(request, "SYS_REGISTRY_EMP", profileEmployeeId);//ไม่แน่ใจEMPปิดไว้ก่อน
|
||||
await new permission().PermissionOrgUserUpdate(request, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||
const profileEmp = await this.profileRepo.findOneBy({ id: profileEmployeeId });
|
||||
if (!profileEmp) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์นี้");
|
||||
|
||||
|
|
@ -2922,7 +2922,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
*/
|
||||
@Get("information/{profileEmployeeId}")
|
||||
async getInformationById(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);//ไม่แน่ใจEMPปิดไว้ก่อน
|
||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||
const profileInformation = await this.profileRepo.findOne({
|
||||
where: { id: profileEmployeeId },
|
||||
});
|
||||
|
|
@ -2953,7 +2953,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
*/
|
||||
@Get("information/history/{profileEmployeeId}")
|
||||
async getInformationHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||
// await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId);//ไม่แน่ใจEMPปิดไว้ก่อน
|
||||
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||
const profileInformation = await this.profileRepo.find({
|
||||
relations: {
|
||||
information_histories: true,
|
||||
|
|
@ -2998,7 +2998,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
@Path() profileEmployeeId: string,
|
||||
@Request() req: RequestWithUser,
|
||||
) {
|
||||
// await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId);//ไม่แน่ใจEMPปิดไว้ก่อน
|
||||
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||
const employment = await this.employmentRepository.find({
|
||||
where: { profileEmployeeId: profileEmployeeId },
|
||||
order: { createdAt: "ASC" },
|
||||
|
|
@ -3023,13 +3023,13 @@ export class ProfileEmployeeController extends Controller {
|
|||
const employment = await this.employmentRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
// if (employment) {
|
||||
// await new permission().PermissionOrgUserGet(
|
||||
// req,
|
||||
// "SYS_REGISTRY_EMP",
|
||||
// employment.profileEmployeeId,
|
||||
// );
|
||||
// }//ไม่แน่ใจEMPปิดไว้ก่อน
|
||||
if (employment) {
|
||||
await new permission().PermissionOrgUserGet(
|
||||
req,
|
||||
"SYS_REGISTRY_EMP",
|
||||
employment.profileEmployeeId,
|
||||
);
|
||||
}
|
||||
return new HttpSuccess(employment);
|
||||
}
|
||||
|
||||
|
|
@ -3045,13 +3045,13 @@ export class ProfileEmployeeController extends Controller {
|
|||
const employment = await this.employmentRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
// if (employment) {
|
||||
// await new permission().PermissionOrgUserList(
|
||||
// req,
|
||||
// "SYS_REGISTRY_EMP",
|
||||
// employment.profileEmployeeId,
|
||||
// );
|
||||
// }//ไม่แน่ใจEMPปิดไว้ก่อน
|
||||
if (employment) {
|
||||
await new permission().PermissionOrgUserList(
|
||||
req,
|
||||
"SYS_REGISTRY_EMP",
|
||||
employment.profileEmployeeId,
|
||||
);
|
||||
}
|
||||
const employmentHistory = await this.employmentHistoryRepository.find({
|
||||
where: { profileEmployeeEmploymentId: id },
|
||||
order: { lastUpdatedAt: "ASC" },
|
||||
|
|
@ -3076,7 +3076,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
where: { id: profileEmployeeId },
|
||||
});
|
||||
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
// await new permission().PermissionOrgUserList(request, "SYS_REGISTRY_EMP", profile.id);//ไม่แน่ใจEMPปิดไว้ก่อน
|
||||
await new permission().PermissionOrgUserUpdate(request, "SYS_REGISTRY_EMP", profile.id);
|
||||
|
||||
const employment = new ProfileEmployeeEmployment();
|
||||
// const history = new ProfileEmployeeEmploymentHistory();
|
||||
|
|
@ -3111,13 +3111,13 @@ export class ProfileEmployeeController extends Controller {
|
|||
const employment = await this.employmentRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
// if (employment) {
|
||||
// await new permission().PermissionOrgUserDelete(
|
||||
// request,
|
||||
// "SYS_REGISTRY_EMP",
|
||||
// employment.profileEmployeeId,
|
||||
// );
|
||||
// }//ไม่แน่ใจEMPปิดไว้ก่อน
|
||||
if (employment) {
|
||||
await new permission().PermissionOrgUserDelete(
|
||||
request,
|
||||
"SYS_REGISTRY_EMP",
|
||||
employment.profileEmployeeId,
|
||||
);
|
||||
}
|
||||
await this.employmentHistoryRepository.delete({
|
||||
profileEmployeeEmploymentId: id,
|
||||
});
|
||||
|
|
@ -3144,11 +3144,11 @@ export class ProfileEmployeeController extends Controller {
|
|||
) {
|
||||
const employment = await this.employmentRepository.findOneBy({ id });
|
||||
if (!employment) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
// await new permission().PermissionOrgUserUpdate(
|
||||
// request,
|
||||
// "SYS_REGISTRY_EMP",
|
||||
// employment.profileEmployeeId,
|
||||
// );//ไม่แน่ใจEMPปิดไว้ก่อน
|
||||
await new permission().PermissionOrgUserUpdate(
|
||||
request,
|
||||
"SYS_REGISTRY_EMP",
|
||||
employment.profileEmployeeId,
|
||||
);
|
||||
|
||||
const history = new ProfileEmployeeEmploymentHistory();
|
||||
Object.assign(history, { ...employment, id: undefined });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue