Fix #3
This commit is contained in:
@@ -513,8 +513,17 @@ export default async function resourceRoutes(server: FastifyInstance) {
|
|||||||
|
|
||||||
let data = {...body, updated_at: new Date().toISOString(), updated_by: userId}
|
let data = {...body, updated_at: new Date().toISOString(), updated_by: userId}
|
||||||
|
|
||||||
|
//@ts-ignore
|
||||||
|
delete data.updatedBy
|
||||||
|
//@ts-ignore
|
||||||
|
delete data.updatedAt
|
||||||
|
|
||||||
|
console.log(data)
|
||||||
|
|
||||||
Object.keys(data).forEach((key) => {
|
Object.keys(data).forEach((key) => {
|
||||||
if(key.includes("_at") || key.includes("At")) {
|
console.log(key)
|
||||||
|
|
||||||
|
if(key.includes("_at") || key.includes("At") || key.toLowerCase().includes("date")) {
|
||||||
data[key] = normalizeDate(data[key])
|
data[key] = normalizeDate(data[key])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user