ผูก log เมนูทะเบียนประวัติ
This commit is contained in:
parent
5643cc67c4
commit
6539804937
76 changed files with 909 additions and 431 deletions
|
|
@ -25,6 +25,7 @@ import {
|
|||
UpdateProfileOther,
|
||||
} from "../entities/ProfileOther";
|
||||
import permission from "../interfaces/permission";
|
||||
import { setLogDataDiff } from "../interfaces/utils";
|
||||
@Route("api/v1/org/profile-temp/other")
|
||||
@Tags("ProfileOther")
|
||||
@Security("bearerAuth")
|
||||
|
|
@ -87,7 +88,7 @@ export class ProfileOtherEmployeeTempController extends Controller {
|
|||
if (!profile) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
||||
}
|
||||
|
||||
const before = null;
|
||||
const data = new ProfileOther();
|
||||
|
||||
const meta = {
|
||||
|
|
@ -103,9 +104,10 @@ export class ProfileOtherEmployeeTempController extends Controller {
|
|||
const history = new ProfileOtherHistory();
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await this.otherRepository.save(data);
|
||||
await this.otherRepository.save(data, { data: req });
|
||||
setLogDataDiff(req, { before, after: data });
|
||||
history.profileOtherId = data.id;
|
||||
await this.otherHistoryRepository.save(history);
|
||||
await this.otherHistoryRepository.save(history, { data: req });
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue