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

@ -79,7 +79,7 @@ export class ProfileAssessmentsController extends Controller {
if (_record) {
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
}
const record = await this.profileAssessmentsHistoryRepository.find({
where: {
profileAssessmentId: assessmentId,
@ -94,9 +94,7 @@ export class ProfileAssessmentsController 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,
@ -139,10 +137,10 @@ export class ProfileAssessmentsController 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();
}