Save
This commit is contained in:
@@ -20,6 +20,17 @@
|
||||
</nuxt-link>
|
||||
</h3>
|
||||
</div>
|
||||
<!---------------------- check user for confirm ---------------------->
|
||||
<div v-else-if="!userConfirm" class="panel is-agent">
|
||||
<h3>
|
||||
<span> برای ثبت درخواست نمایندگی باید </span>
|
||||
<nuxt-link :to="{ name: 'account' }"
|
||||
> حساب کاربری</nuxt-link
|
||||
>
|
||||
<span> خود را تایید کنید. </span>
|
||||
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<!---------------------- check if user already is agent ---------------------->
|
||||
<div v-else-if="$auth.loggedIn && $auth.hasScope('user') && user.isAgent" class="panel is-agent">
|
||||
@@ -63,6 +74,9 @@ export default {
|
||||
},
|
||||
userFullName() {
|
||||
return this.user.first_name + ' ' + this.user.last_name
|
||||
},
|
||||
userConfirm() {
|
||||
return this.user.confirmed
|
||||
}
|
||||
},
|
||||
methods: {}
|
||||
|
||||
@@ -173,7 +173,12 @@ module.exports.add_representation = [
|
||||
checkValidations(validationResult),
|
||||
async (req, res) => {
|
||||
const { user_id } = req
|
||||
if (!user_id) throw new Error('invalid user id')
|
||||
const userData = await User.findById(user_id)
|
||||
|
||||
if (!userData || !userData.confirmed){
|
||||
res.status(400).json({msg:'اول شماره تلفن و ایمیل خود را تایید کنید'})
|
||||
|
||||
}else{
|
||||
const {
|
||||
representation_type,
|
||||
full_name,
|
||||
@@ -316,6 +321,8 @@ module.exports.add_representation = [
|
||||
return res500(res, e)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.edit_representation_by_user = [
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ const inHostUrl = 'mongodb://root:KPTt76tImNBBMm4Kor8QA9gB@asan-service:27017/as
|
||||
const outHostUrl = 'mongodb://root:KPTt76tImNBBMm4Kor8QA9gB@hotaka.liara.cloud:33794/asanserv_database?authSource=admin'
|
||||
const init = ()=>{
|
||||
try {
|
||||
mongoose.connect(inHostUrl, {
|
||||
mongoose.connect(outHostUrl, {
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true,
|
||||
useFindAndModify: false,
|
||||
|
||||
Reference in New Issue
Block a user