Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Com 3409 #1779

Merged
merged 4 commits into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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