log admin , master (ยกเว้น menu ข้อมูลปฎิทินวันหยุด)
This commit is contained in:
parent
e59f4f13e2
commit
f0e5a83d02
11 changed files with 122 additions and 63 deletions
|
|
@ -106,14 +106,15 @@ export class EmployeePositionController extends Controller {
|
|||
if (rowRepeated) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ข้อมูล Row นี้มีอยู่ในระบบแล้ว");
|
||||
}
|
||||
|
||||
const before = null;
|
||||
empPosDict.createdUserId = request.user.sub;
|
||||
empPosDict.createdFullName = request.user.name;
|
||||
empPosDict.createdAt = new Date();
|
||||
empPosDict.lastUpdateUserId = request.user.sub;
|
||||
empPosDict.lastUpdateFullName = request.user.name;
|
||||
empPosDict.lastUpdatedAt = new Date();
|
||||
await this.employeePosDictRepository.save(empPosDict);
|
||||
await this.employeePosDictRepository.save(empPosDict, { data: request });
|
||||
setLogDataDiff(request, { before, after: empPosDict });
|
||||
return new HttpSuccess(empPosDict.id);
|
||||
}
|
||||
|
||||
|
|
@ -163,12 +164,13 @@ export class EmployeePositionController extends Controller {
|
|||
if (rowRepeated) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ข้อมูล Row นี้มีอยู่ในระบบแล้ว");
|
||||
}
|
||||
|
||||
const before = structuredClone(empPosDict);
|
||||
empPosDict.lastUpdateUserId = request.user.sub;
|
||||
empPosDict.lastUpdateFullName = request.user.name;
|
||||
empPosDict.lastUpdatedAt = new Date();
|
||||
this.employeePosDictRepository.merge(empPosDict, requestBody);
|
||||
await this.employeePosDictRepository.save(empPosDict);
|
||||
await this.employeePosDictRepository.save(empPosDict,{data: request});
|
||||
setLogDataDiff( request, { before, after: empPosDict });
|
||||
return new HttpSuccess(empPosDict.id);
|
||||
}
|
||||
|
||||
|
|
@ -186,7 +188,7 @@ export class EmployeePositionController extends Controller {
|
|||
if (!delEmpPosDict) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งลูกจ้างประจำนี้");
|
||||
}
|
||||
await this.employeePosDictRepository.remove(delEmpPosDict);
|
||||
await this.employeePosDictRepository.remove(delEmpPosDict, { data: request });
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue