From 6a853738e51cb24cb1b18ba20e20473a26e1e3e1 Mon Sep 17 00:00:00 2001 From: Petr Jasek Date: Fri, 6 Sep 2024 11:47:25 +0200 Subject: [PATCH] display related planning items also for secondary links STT-70 --- server/features/events.feature | 9 +++++++++ server/planning/events/events.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/server/features/events.feature b/server/features/events.feature index da5a4c999..e0da2d6c6 100644 --- a/server/features/events.feature +++ b/server/features/events.feature @@ -1713,6 +1713,15 @@ Feature: Events """ {"related_events": [{"_id": "#events._id#", "link_type": "secondary"}]} """ + When we get "/events/event_1" + Then we get existing resource + """ + { + "planning_ids": [ + "plan1" + ] + } + """ @auth Scenario: Link new Event with one_primary link method diff --git a/server/planning/events/events.py b/server/planning/events/events.py index 49d0f9b5e..058894b7f 100644 --- a/server/planning/events/events.py +++ b/server/planning/events/events.py @@ -174,7 +174,7 @@ def on_fetched_item(self, doc): self._enhance_event_item(doc) def _enhance_event_item(self, doc): - plannings = get_related_planning_for_events([doc[config.ID_FIELD]], "primary") + plannings = get_related_planning_for_events([doc[config.ID_FIELD]]) if len(plannings): doc["planning_ids"] = [planning.get("_id") for planning in plannings]