add delete_at when user is deactivated
This commit is contained in:
@@ -59,6 +59,7 @@ const schema = {
|
||||
notify_props: Joi.object({
|
||||
mention_keys: Joi.string().optional().allow(''),
|
||||
}).optional(),
|
||||
delete_at: Joi.number().integer().min(0).optional(),
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -59,6 +59,10 @@ module.exports = async function(context) {
|
||||
if (!user.roles.length) {
|
||||
delete user.roles
|
||||
}
|
||||
if (result.active === false) {
|
||||
user.delete_at = result._updatedAt ? new Date(result._updatedAt).getTime() : Date.now()
|
||||
}
|
||||
|
||||
const avatar = await getAvatar(context, result)
|
||||
if (avatar) {
|
||||
user.profile_image = avatar
|
||||
|
||||
Reference in New Issue
Block a user