add prepare data log method:POST
This commit is contained in:
parent
cc26192b65
commit
29527c512e
8 changed files with 32 additions and 14 deletions
|
|
@ -26,7 +26,7 @@ import {
|
|||
import { PosType } from "../entities/PosType";
|
||||
import { PosLevel } from "../entities/PosLevel";
|
||||
import { RequestWithUser } from "../middlewares/user";
|
||||
import { addLogSequence } from "../interfaces/utils";
|
||||
import { addLogSequence, setLogDataDiff } from "../interfaces/utils";
|
||||
|
||||
@Route("api/v1/development/history/officer")
|
||||
@Tags("DevelopmentOfficerHistory")
|
||||
|
|
@ -110,7 +110,7 @@ export class DevelopmentOfficerHistoryController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลระดับตำแหน่ง");
|
||||
}
|
||||
}
|
||||
|
||||
const before = null;
|
||||
const development = Object.assign(new DevelopmentHistory(), requestBody);
|
||||
development.type = type;
|
||||
development.createdUserId = request.user.sub;
|
||||
|
|
@ -123,6 +123,7 @@ export class DevelopmentOfficerHistoryController extends Controller {
|
|||
description: "Store DevelopmentHistory.",
|
||||
});
|
||||
await this.developmentHistoryRepository.save(development, { data: request });
|
||||
setLogDataDiff(request, { before, after: development });
|
||||
return new HttpSuccess(development.id);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue