diff --git a/src/components/Feature/FeatureFetchOffsetRoute.vue b/src/components/Feature/FeatureFetchOffsetRoute.vue index 2585854c27cbe8016ead8d87a935e62be308c1c4..d0c4e65dae4922a0c77d714df7943eddf393036b 100644 --- a/src/components/Feature/FeatureFetchOffsetRoute.vue +++ b/src/components/Feature/FeatureFetchOffsetRoute.vue @@ -1,6 +1,6 @@ <template> <router-link - :is="position >= 0 ? 'router-link' : 'span'" + :is="query && position >= 0 ? 'router-link' : 'span'" :to="{ name: 'details-signalement-filtre', params: { slug }, @@ -47,14 +47,18 @@ export default { 'project' ]), query() { - const searchParams = { ordering: this.ordering }; - if (this.filter === 'feature_type_slug') { // when feature_type is the default filter of the project, - searchParams['feature_type_slug'] = this.properties.feature_type.slug; // get its slug for the current feature - } - if (this.position >= 0) { - searchParams['offset'] = this.position; // get its slug for the current feature + if (this.ordering) { + + const searchParams = { ordering: this.ordering }; + if (this.filter === 'feature_type_slug') { // when feature_type is the default filter of the project, + searchParams['feature_type_slug'] = this.properties.feature_type.slug; // get its slug for the current feature + } + if (this.position >= 0) { + searchParams['offset'] = this.position; // get its slug for the current feature + } + return searchParams; } - return searchParams; + return null; }, },