add prepare data log method:POST
This commit is contained in:
parent
cc26192b65
commit
29527c512e
8 changed files with 32 additions and 14 deletions
|
|
@ -42,7 +42,7 @@ import HttpError from "../interfaces/http-error";
|
|||
import HttpStatus from "../interfaces/http-status";
|
||||
import HttpSuccess from "../interfaces/http-success";
|
||||
import { Check } from "typeorm";
|
||||
import { addLogSequence } from "../interfaces/utils";
|
||||
import { addLogSequence, setLogDataDiff } from "../interfaces/utils";
|
||||
import { RequestWithUser } from "../middlewares/user";
|
||||
|
||||
@Route("api/v1/development/strategy")
|
||||
|
|
@ -199,7 +199,7 @@ export class StrategyController extends Controller {
|
|||
default:
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "levelnode ไม่ถูกต้อง");
|
||||
}
|
||||
|
||||
const before = null;
|
||||
strategyChild.createdUserId = request.user.sub;
|
||||
strategyChild.createdFullName = request.user.name;
|
||||
strategyChild.lastUpdateUserId = request.user.sub;
|
||||
|
|
@ -210,6 +210,7 @@ export class StrategyController extends Controller {
|
|||
description: "Store Strategy.",
|
||||
});
|
||||
await repoSave.save(strategyChild, { data: request });
|
||||
setLogDataDiff(request, { before, after: strategyChild });
|
||||
|
||||
return new HttpSuccess(strategyChild.id);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue