Skip to content

Commit

Permalink
Merge pull request #1779 from sophiemoustard/COM-3409
Browse files Browse the repository at this point in the history
Com 3409
  • Loading branch information
ulysseferreira committed Mar 6, 2023
2 parents 4c5ac42 + ac80800 commit dba8d5d
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 19 deletions.
56 changes: 45 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -20,7 +20,7 @@
"@quasar/extras": "~1.15.10",
"@vuelidate/core": "~2.0.0-alpha.41",
"@vuelidate/validators": "~2.0.0-alpha.29",
"axios": "~0.27.2",
"axios": "~1.3.4",
"bignumber.js": "~9.1.1",
"chart.js": "~3.8.0",
"connect-history-api-fallback": "~1.6.0",
Expand Down
2 changes: 1 addition & 1 deletion src/core/api/ressources/alenviAxios.js
Expand Up @@ -5,7 +5,7 @@ import { logOutAndRedirectToLogin } from 'src/router/redirect';

const instance = axios.create({
withCredentials: true,
paramsSerializer: params => qs.stringify(params, { indices: false }),
paramsSerializer: { serialize: params => qs.stringify(params, { indices: false }) },
});

instance.interceptors.request.use(async config => config, err => Promise.reject(err));
Expand Down
4 changes: 2 additions & 2 deletions src/core/components/menu/SideMenuFooter.vue
Expand Up @@ -69,8 +69,8 @@ export default {
goToProfile () {
if (!/account/.test(this.$route.name)) {
return /\/ad\//.test(this.$route.path)
? this.$router.push({ name: 'account vendor', params: { id: this.userId } })
: this.$router.push({ name: 'account client', params: { id: this.userId } });
? this.$router.push({ name: 'account vendor' })
: this.$router.push({ name: 'account client' });
}
},
switchInterface () {
Expand Down
7 changes: 3 additions & 4 deletions src/modules/client/router/routes.js
Expand Up @@ -21,20 +21,19 @@ const routes = [
const canNav = await canNavigate();
if (!canNav) return logOutAndRedirectToLogin();

const { loggedUser } = store.state.main;
const userVendorRole = store.getters['main/getVendorRole'];
const userClientRole = store.getters['main/getClientRole'];
if (!userClientRole && !userVendorRole) return next({ name: 'account client', params: { id: loggedUser._id } });
if (!userClientRole && !userVendorRole) return next({ name: 'account client' });
if (!userClientRole) return next({ path: '/ad' });

const company = store.getters['main/getCompany'];
if (userClientRole === HELPER) return next({ name: 'customers agenda' });
if (userClientRole === AUXILIARY_WITHOUT_COMPANY) {
return next({ name: 'account client', params: { id: loggedUser._id } });
return next({ name: 'account client' });
}
if (AUXILIARY_ROLES.includes(userClientRole)) {
if (get(company, 'subscriptions.erp')) return next({ name: 'auxiliaries agenda' });
return next({ name: 'account client', params: { id: loggedUser._id } });
return next({ name: 'account client' });
}
if (COACH_ROLES.includes(userClientRole)) {
if (get(company, 'subscriptions.erp')) return next({ name: 'ni auxiliaries' });
Expand Down

0 comments on commit dba8d5d

Please sign in to comment.