From 7c0e23b475d37019216377fd4bd692a2931b373a Mon Sep 17 00:00:00 2001 From: Bruno Besson Date: Thu, 29 Apr 2021 14:51:30 +0200 Subject: [PATCH] Filter crags from non climbing sites waypoints --- src/views/document/utils/boxes/RoutesBox.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/views/document/utils/boxes/RoutesBox.vue b/src/views/document/utils/boxes/RoutesBox.vue index fc56a12d38..5e9dc0d29e 100644 --- a/src/views/document/utils/boxes/RoutesBox.vue +++ b/src/views/document/utils/boxes/RoutesBox.vue @@ -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() {