fix
This commit is contained in:
@@ -283,8 +283,12 @@ module.exports.add_representation = [
|
||||
data.representation_code = representation_code
|
||||
|
||||
const representation = new Representation(data)
|
||||
await representation.save()
|
||||
const user = await User.findById(user_id)
|
||||
if(!user){
|
||||
res404(res,"آین کاربر در دیتای ما وجود ندارد")
|
||||
}else{
|
||||
await representation.save()
|
||||
}
|
||||
user.askedForRepresentation = true
|
||||
user.representation_code = representation_code
|
||||
await user.save()
|
||||
|
||||
Reference in New Issue
Block a user