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];
|
const messageRetour=[txtGeneral.updateOkMessage];
|
||||||
if(req.body.newPassword)
|
if(req.body.newPassword)
|
||||||
req.body.password=await bcrypt.hash(req.body.newPassword, config.bcryptSaltRounds);
|
req.body.password=await bcrypt.hash(req.body.newPassword, config.bcryptSaltRounds);
|
||||||
if(tool.isEmpty(req.body.newGodfatherId))
|
if(req.body.newGodfatherId!=undefined)
|
||||||
req.body.GodfatherId=null;
|
{
|
||||||
else if(req.body.newGodfatherId && req.body.newGodfatherId!==req.params.id && await searchUserById(req.body.newGodfatherId))
|
const godFather=searchIdGodfather(req.body.newGodfatherId);
|
||||||
req.body.GodfatherId=req.body.newGodfatherId;
|
if(empty(godFather))
|
||||||
else
|
messageRetour.push(txt.updatedNeedGoodGodfather);
|
||||||
messageRetour.push(txt.updatedNeedGoodGodfather);
|
else
|
||||||
|
req.body.GodfatherId=godFather.id;
|
||||||
|
}
|
||||||
|
console.log(req.body);
|
||||||
switch(req.connectedUser.User.status)
|
switch(req.connectedUser.User.status)
|
||||||
{
|
{
|
||||||
case "admin":
|
case "admin":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user