fix
This commit is contained in:
parent
8b1543342c
commit
281c5c7dfd
2 changed files with 41 additions and 41 deletions
|
|
@ -2891,7 +2891,7 @@ export class ProfileEmployeeTempController extends Controller {
|
|||
@Path() profileEmployeeId: string,
|
||||
@Body() body: UpdateInformationProfileEmployee,
|
||||
) {
|
||||
// await new permission().PermissionUpdate(request, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
|
||||
await new permission().PermissionUpdate(request, "SYS_REGISTRY_TEMP");
|
||||
const profileEmp = await this.profileRepo.findOneBy({ id: profileEmployeeId });
|
||||
if (!profileEmp) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์นี้");
|
||||
|
||||
|
|
@ -2920,7 +2920,7 @@ export class ProfileEmployeeTempController extends Controller {
|
|||
*/
|
||||
@Get("information/{profileEmployeeId}")
|
||||
async getInformationById(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||
// await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
|
||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||
const profileInformation = await this.profileRepo.findOne({
|
||||
where: { id: profileEmployeeId },
|
||||
});
|
||||
|
|
@ -2951,7 +2951,7 @@ export class ProfileEmployeeTempController extends Controller {
|
|||
*/
|
||||
@Get("information/history/{profileEmployeeId}")
|
||||
async getInformationHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||
// await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
|
||||
await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");
|
||||
const profileInformation = await this.profileRepo.find({
|
||||
relations: {
|
||||
information_histories: true,
|
||||
|
|
@ -2996,7 +2996,7 @@ export class ProfileEmployeeTempController extends Controller {
|
|||
@Path() profileEmployeeId: string,
|
||||
@Request() req: RequestWithUser,
|
||||
) {
|
||||
// await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
|
||||
await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");
|
||||
const employment = await this.employmentRepository.find({
|
||||
where: { profileEmployeeId: profileEmployeeId },
|
||||
order: { createdAt: "ASC" },
|
||||
|
|
@ -3018,7 +3018,7 @@ export class ProfileEmployeeTempController extends Controller {
|
|||
*/
|
||||
@Get("employment/id/{id}")
|
||||
async GetEmploymentById(@Path() id: string, @Request() req: RequestWithUser) {
|
||||
// await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
|
||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||
const employment = await this.employmentRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
|
|
@ -3034,7 +3034,7 @@ export class ProfileEmployeeTempController extends Controller {
|
|||
*/
|
||||
@Get("employment/history/{id}")
|
||||
async GetHistoryEmploymentById(@Path() id: string, @Request() req: RequestWithUser) {
|
||||
// await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
|
||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||
const employmentHistory = await this.employmentHistoryRepository.find({
|
||||
where: { profileEmployeeEmploymentId: id },
|
||||
order: { lastUpdatedAt: "ASC" },
|
||||
|
|
@ -3055,7 +3055,7 @@ export class ProfileEmployeeTempController extends Controller {
|
|||
@Body() body: CreateEmploymentProfileEmployee,
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
// await new permission().PermissionCreate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
|
||||
await new permission().PermissionUpdate(request, "SYS_REGISTRY_TEMP");
|
||||
const profile = await this.profileRepo.findOne({
|
||||
where: { id: profileEmployeeId },
|
||||
});
|
||||
|
|
@ -3090,8 +3090,8 @@ export class ProfileEmployeeTempController extends Controller {
|
|||
* @param {string} id Id ข้อมูลการจ้าง
|
||||
*/
|
||||
@Delete("employment/{id}")
|
||||
async DeleteEmployment(@Path() id: string) {
|
||||
// await new permission().PermissionDelete(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
|
||||
async DeleteEmployment(@Path() id: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionDelete(req, "SYS_REGISTRY_TEMP");
|
||||
await this.employmentHistoryRepository.delete({
|
||||
profileEmployeeEmploymentId: id,
|
||||
});
|
||||
|
|
@ -3116,7 +3116,7 @@ export class ProfileEmployeeTempController extends Controller {
|
|||
@Path() id: string,
|
||||
@Body() body: UpdateEmploymentProfileEmployee,
|
||||
) {
|
||||
// await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
|
||||
await new permission().PermissionUpdate(request, "SYS_REGISTRY_TEMP");
|
||||
const employment = await this.employmentRepository.findOneBy({ id });
|
||||
if (!employment) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue