Correction bug supprimant involontairement le parrain d'un utilisateur.
This commit is contained in:
parent
5c8d68733f
commit
7c8e38bfb9
@ -589,12 +589,15 @@ exports.modify = async (req, res, next) =>
|
||||
const messageRetour=[txtGeneral.updateOkMessage];
|
||||
if(req.body.newPassword)
|
||||
req.body.password=await bcrypt.hash(req.body.newPassword, config.bcryptSaltRounds);
|
||||
if(tool.isEmpty(req.body.newGodfatherId))
|
||||
req.body.GodfatherId=null;
|
||||
else if(req.body.newGodfatherId && req.body.newGodfatherId!==req.params.id && await searchUserById(req.body.newGodfatherId))
|
||||
req.body.GodfatherId=req.body.newGodfatherId;
|
||||
else
|
||||
messageRetour.push(txt.updatedNeedGoodGodfather);
|
||||
if(req.body.newGodfatherId!=undefined)
|
||||
{
|
||||
const godFather=searchIdGodfather(req.body.newGodfatherId);
|
||||
if(empty(godFather))
|
||||
messageRetour.push(txt.updatedNeedGoodGodfather);
|
||||
else
|
||||
req.body.GodfatherId=godFather.id;
|
||||
}
|
||||
console.log(req.body);
|
||||
switch(req.connectedUser.User.status)
|
||||
{
|
||||
case "admin":
|
||||
|
Loading…
x
Reference in New Issue
Block a user