@@ -8,7 +8,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DISCORD_WEBHOOK_URL: 'https://canary.discord.com/api/webhooks/1266738294226554953/xLG8rouRFIAJJGSgroDyjorzkh1vxn6b2QqlLM44Y1rONt8F0rGkAB5v5VKY1h_znQW6'
|
DISCORD_WEBHOOK_URL: 'https://discord.com/api/webhooks/1269741326543487006/NVr2BlA8FTrIfIybH6FqWkb4SAFqy5R7HRFs75HfI7gEegvkuuPZhHToimOC5mOtOeLG'
|
||||||
LIARA_TOKEN: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySUQiOiI2NGVkY2ZmYWJiODUyOWZmNWFmOTU3YmEiLCJpYXQiOjE3MjQwMjIzNDh9._yOIB8GSaXuVmqsoACg68fgk0RrWR-Dp15_o02sobEI
|
LIARA_TOKEN: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySUQiOiI2NGVkY2ZmYWJiODUyOWZmNWFmOTU3YmEiLCJpYXQiOjE3MjQwMjIzNDh9._yOIB8GSaXuVmqsoACg68fgk0RrWR-Dp15_o02sobEI
|
||||||
APP_NAME: asanservice
|
APP_NAME: asanservice
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,17 @@
|
|||||||
</nuxt-link>
|
</nuxt-link>
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</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 ---------------------->
|
<!---------------------- check if user already is agent ---------------------->
|
||||||
<div v-else-if="$auth.loggedIn && $auth.hasScope('user') && user.isAgent" class="panel is-agent">
|
<div v-else-if="$auth.loggedIn && $auth.hasScope('user') && user.isAgent" class="panel is-agent">
|
||||||
@@ -63,6 +74,9 @@ export default {
|
|||||||
},
|
},
|
||||||
userFullName() {
|
userFullName() {
|
||||||
return this.user.first_name + ' ' + this.user.last_name
|
return this.user.first_name + ' ' + this.user.last_name
|
||||||
|
},
|
||||||
|
userConfirm() {
|
||||||
|
return this.user.confirmed
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {}
|
methods: {}
|
||||||
|
|||||||
@@ -173,7 +173,12 @@ module.exports.add_representation = [
|
|||||||
checkValidations(validationResult),
|
checkValidations(validationResult),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
const { user_id } = req
|
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 {
|
const {
|
||||||
representation_type,
|
representation_type,
|
||||||
full_name,
|
full_name,
|
||||||
@@ -316,6 +321,8 @@ module.exports.add_representation = [
|
|||||||
return res500(res, e)
|
return res500(res, e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
module.exports.edit_representation_by_user = [
|
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 outHostUrl = 'mongodb://root:KPTt76tImNBBMm4Kor8QA9gB@hotaka.liara.cloud:33794/asanserv_database?authSource=admin'
|
||||||
const init = ()=>{
|
const init = ()=>{
|
||||||
try {
|
try {
|
||||||
mongoose.connect(inHostUrl, {
|
mongoose.connect(outHostUrl, {
|
||||||
useNewUrlParser: true,
|
useNewUrlParser: true,
|
||||||
useUnifiedTopology: true,
|
useUnifiedTopology: true,
|
||||||
useFindAndModify: false,
|
useFindAndModify: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user