fixingaadd create by, created at, updated at & updated by
This commit is contained in:
@ -268,6 +268,8 @@ export class UserController {
|
||||
}
|
||||
|
||||
data.hashPassword()
|
||||
data.created_by = req.auth.data.name
|
||||
data.created_at = new Date()
|
||||
|
||||
await OrmHelper.DB.manager.save(data)
|
||||
|
||||
@ -591,6 +593,8 @@ export class UserController {
|
||||
data.username = param.username
|
||||
data.email = param.email
|
||||
data.status = param.status
|
||||
data.updated_by = req.auth.data.name
|
||||
data.updated_at = new Date()
|
||||
|
||||
if (param.employee_id && param.employee_id != "") {
|
||||
const employee = await OrmHelper.DB.manager.getRepository(HrmsEmployee).findOneByOrFail({ id: param.employee_id })
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Request, Response, NextFunction } from "express"
|
||||
import { Response, NextFunction } from "express"
|
||||
import { ReturnHelper } from "../helpers/express/return"
|
||||
import { OrmHelper } from "../helpers/orm"
|
||||
import Joi from "joi"
|
||||
@ -10,6 +10,7 @@ import { Status } from "entity"
|
||||
import { RoleList } from "entity"
|
||||
import * as fastcsv from "fast-csv"
|
||||
import dayjs from "dayjs"
|
||||
import { Request } from "express-jwt"
|
||||
|
||||
const log: Logger<ILogObj> = new Logger({ name: "[UserRoleController]", type: "pretty" })
|
||||
|
||||
@ -258,6 +259,8 @@ export class UserRoleController {
|
||||
data.roles = param.roles
|
||||
data.status = param.status
|
||||
data.application = await repo_app.findOneBy({ id: param.application })
|
||||
data.created_by = req.auth.data.name
|
||||
data.created_at = new Date()
|
||||
|
||||
await OrmHelper.DB.manager.save(data)
|
||||
|
||||
@ -323,6 +326,8 @@ export class UserRoleController {
|
||||
data.roles = param.roles
|
||||
data.status = param.status
|
||||
data.application = await repo_app.findOneBy({ id: param.application })
|
||||
data.updated_by = req.auth.data.name
|
||||
data.updated_at = new Date()
|
||||
|
||||
await repo.save(data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user