Skip to content

Commit

Permalink
Merge pull request #1867 from c2corg/filter-crags-from-climbing-sites…
Browse files Browse the repository at this point in the history
…-waypoints

Filter crags from non climbing sites waypoints
  • Loading branch information
brunobesson authored Apr 29, 2021
2 parents 18b45e7 + 7c0e23b commit 3378769
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/views/document/utils/boxes/RoutesBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,14 @@ export default {
},
source() {
return (this.document.associations.routes || this.document.associations.all_routes.documents)
let routes = (this.document.associations.routes || this.document.associations.all_routes.documents)
.map((route) => ({ ...route, title: this.$documentUtils.getDocumentTitle(route, this.$route.params.lang) }))
.sort((r1, r2) => r1.title.localeCompare(r2.title));
if (this.document.type === 'w' && this.document?.waypoint_type !== 'climbing_outdoor') {
// filter out crags for non climbing sites waypoints
routes = routes.filter((route) => route?.climbing_outdoor_type !== 'single');
}
return routes;
},
routes() {
Expand Down

0 comments on commit 3378769

Please sign in to comment.