From 9670b77bc38cf0c2c43448962bdb4738830be5b3 Mon Sep 17 00:00:00 2001 From: Jonathan Reinbrecht Date: Fri, 19 Jan 2024 13:59:01 +0100 Subject: [PATCH] [IMP] move filtering of past events in related events section to backend --- lib/mobilizon/events/events.ex | 1 + src/views/Event/EventView.vue | 15 ++------------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/mobilizon/events/events.ex b/lib/mobilizon/events/events.ex index 91e683dbf..a489d9a86 100644 --- a/lib/mobilizon/events/events.ex +++ b/lib/mobilizon/events/events.ex @@ -1774,6 +1774,7 @@ defmodule Mobilizon.Events do |> distinct([e], e.id) |> join(:left, [e], et in "events_tags", on: e.id == et.event_id) |> join(:left, [e], a in Address, on: e.physical_address_id == a.id) + |> filter_future_events(true) |> filter_draft() |> filter_local_or_from_followed_instances_events() |> filter_public_visibility() diff --git a/src/views/Event/EventView.vue b/src/views/Event/EventView.vue index d87198c40..e086b962a 100755 --- a/src/views/Event/EventView.vue +++ b/src/views/Event/EventView.vue @@ -243,12 +243,12 @@

{{ t("These events may interest you") }}

- +
{ return organizer.value?.domain ?? undefined; }); -const nonPassedRelatedEvents = computed((): IEvent[] | undefined => { - const relatedEvents = event.value?.relatedEvents; - - return relatedEvents?.filter((relatedEvent: IEvent) => { - const endsOn = relatedEvent.endsOn - ? new Date(relatedEvent.endsOn) - : new Date(relatedEvent.beginsOn); - return endsOn > new Date(); - }); -}); - useHead({ title: computed(() => eventTitle.value ?? ""), meta: [{ name: "description", content: eventDescription.value }],