mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
21 lines
577 B
JavaScript
21 lines
577 B
JavaScript
const setCreatedAt = (resolve, root, args, context, info) => {
|
|
args.createdAt = new Date().toISOString()
|
|
return resolve(root, args, context, info)
|
|
}
|
|
const setUpdatedAt = (resolve, root, args, context, info) => {
|
|
args.updatedAt = new Date().toISOString()
|
|
return resolve(root, args, context, info)
|
|
}
|
|
|
|
export default {
|
|
Mutation: {
|
|
CreatePost: setCreatedAt,
|
|
CreateComment: setCreatedAt,
|
|
CreateOrganization: setCreatedAt,
|
|
UpdateUser: setUpdatedAt,
|
|
UpdatePost: setUpdatedAt,
|
|
UpdateComment: setUpdatedAt,
|
|
UpdateOrganization: setUpdatedAt,
|
|
},
|
|
}
|