Add user deletion in deleteAllUserData method to remove user account along with associated data
Despliegue Automático / desplegar (push) Successful in 35s
Despliegue Automático / desplegar (push) Successful in 35s
This commit is contained in:
@@ -98,6 +98,7 @@ class AuthService {
|
|||||||
await Note.destroy({ where: { userId }, transaction });
|
await Note.destroy({ where: { userId }, transaction });
|
||||||
await Category.destroy({ where: { userId }, transaction });
|
await Category.destroy({ where: { userId }, transaction });
|
||||||
await RefreshToken.destroy({ where: { userId }, transaction });
|
await RefreshToken.destroy({ where: { userId }, transaction });
|
||||||
|
await User.destroy({ where: { id: userId }, transaction });
|
||||||
|
|
||||||
return {
|
return {
|
||||||
message: 'Datos del usuario eliminados correctamente; se eliminaron todos los tokens.'
|
message: 'Datos del usuario eliminados correctamente; se eliminaron todos los tokens.'
|
||||||
|
|||||||
Reference in New Issue
Block a user