add dpis controller

This commit is contained in:
Suphonchai Phoonsawat 2024-10-07 14:53:27 +07:00
parent 497decefe4
commit 4852131651
74 changed files with 606 additions and 336 deletions

View file

@ -75,7 +75,11 @@ export class ProfileAssessmentsEmployeeController extends Controller {
) {
const _record = await this.profileAssessmentsRepository.findOneBy({ id: assessmentId });
if (_record) {
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId);
await new permission().PermissionOrgUserGet(
req,
"SYS_REGISTRY_EMP",
_record.profileEmployeeId,
);
}
const record = await this.profileAssessmentsHistoryRepository.find({
where: {
@ -91,9 +95,7 @@ export class ProfileAssessmentsEmployeeController extends Controller {
}
@Get("history/{assessmentId}")
public async getProfileAssessmentsHistory(
@Path() assessmentId: string,
) {
public async getProfileAssessmentsHistory(@Path() assessmentId: string) {
const record = await this.profileAssessmentsHistoryRepository.find({
where: {
profileAssessmentId: assessmentId,
@ -136,10 +138,10 @@ export class ProfileAssessmentsEmployeeController extends Controller {
Object.assign(history, { ...data, id: undefined });
await this.profileAssessmentsRepository.save(data, { data: req });
setLogDataDiff( req, { before, after: data });
setLogDataDiff(req, { before, after: data });
history.profileAssessmentId = data.id;
await this.profileAssessmentsHistoryRepository.save(history, { data: req });
setLogDataDiff( req, { before, after: history });
setLogDataDiff(req, { before, after: history });
return new HttpSuccess();
}