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

@ -57,7 +57,10 @@ export class ProfileCertificateEmployeeTempController extends Controller {
}
@Get("admin/history/{certificateId}")
public async certificateAdminHistory(@Path() certificateId: string, @Request() req: RequestWithUser) {
public async certificateAdminHistory(
@Path() certificateId: string,
@Request() req: RequestWithUser,
) {
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
const record = await this.certificateHistoryRepo.find({
where: {
@ -111,10 +114,10 @@ export class ProfileCertificateEmployeeTempController extends Controller {
Object.assign(history, { ...data, id: undefined });
await this.certificateRepo.save(data, { data: req });
setLogDataDiff( req , {before, after: data});
setLogDataDiff(req, { before, after: data });
history.profileCertificateId = data.id;
await this.certificateHistoryRepo.save(history, { data: req });
setLogDataDiff( req , {before, after: history});
setLogDataDiff(req, { before, after: history });
return new HttpSuccess();
}
@ -149,11 +152,11 @@ export class ProfileCertificateEmployeeTempController extends Controller {
await Promise.all([
this.certificateRepo.save(record, { data: req }),
setLogDataDiff( req , {before, after: record}),
setLogDataDiff(req, { before, after: record }),
this.certificateHistoryRepo.save(history, { data: req }),
setLogDataDiff( req , {before: before_null, after: history}),
setLogDataDiff(req, { before: before_null, after: history }),
]);
return new HttpSuccess();
}