Skip to content
Snippets Groups Projects
Commit ff2e8693 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

prevent error on router without position & logs

parent 61453c06
No related branches found
No related tags found
1 merge request!519REDMINE_ISSUE-15534| Amélioration du parcours de signalements - Activer le parcours de signalements sur tous les clics sur un signalement + affichage du tri et du filtre courants
This commit is part of merge request !519. Comments created here will be created in the context of that merge request.
<template> <template>
<router-link <router-link
:is="position ? 'span' : 'router-link'"
:to="{ :to="{
name: 'details-signalement-filtre', name: 'details-signalement-filtre',
params: { params: {
...@@ -59,15 +60,21 @@ export default { ...@@ -59,15 +60,21 @@ export default {
}, },
created() { created() {
this.getFeaturePosition(this.featureId).then((position) => { this.getFeaturePosition(this.featureId)
if (position >= 0) { .then((position) => {
this.position = position; if (position >= 0) {
} console.log(position);
}); this.position = position;
}
})
.catch((error) => {
console.log(error);
});
}, },
methods: { methods: {
async getFeaturePosition(featureId) { async getFeaturePosition(featureId) {
console.log(this.$store.state.configuration.VUE_APP_DJANGO_API_BASE);
const url = new URL(`${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.slug}/feature/${featureId}/position-in-list/`); const url = new URL(`${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.slug}/feature/${featureId}/position-in-list/`);
url.search = new URLSearchParams(this.query); url.search = new URLSearchParams(this.query);
const response = await axios.get(url); const response = await axios.get(url);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment