From 297b161a04fb61a37d5981359a19776e762d1a7b Mon Sep 17 00:00:00 2001 From: Mats Eriksson Date: Tue, 7 May 2024 14:47:05 +0300 Subject: [PATCH] add the toggle to each search so only relevant units are shown in filter --- apps/ui/modules/queries/params.tsx | 4 ++++ apps/ui/pages/search/index.tsx | 1 + apps/ui/pages/search/single.tsx | 1 + 3 files changed, 6 insertions(+) diff --git a/apps/ui/modules/queries/params.tsx b/apps/ui/modules/queries/params.tsx index 3abd99c854..7ced85a2b6 100644 --- a/apps/ui/modules/queries/params.tsx +++ b/apps/ui/modules/queries/params.tsx @@ -4,11 +4,15 @@ export const SEARCH_FORM_PARAMS_UNIT = gql` query SearchFormParamsUnit( $publishedReservationUnits: Boolean $ownReservations: Boolean + $onlyDirectBookable: Boolean + $onlySeasonalBookable: Boolean $orderBy: [UnitOrderingChoices] ) { units( publishedReservationUnits: $publishedReservationUnits ownReservations: $ownReservations + onlyDirectBookable: $onlyDirectBookable + onlySeasonalBookable: $onlySeasonalBookable orderBy: $orderBy ) { edges { diff --git a/apps/ui/pages/search/index.tsx b/apps/ui/pages/search/index.tsx index 6a36b45538..43389f97ac 100644 --- a/apps/ui/pages/search/index.tsx +++ b/apps/ui/pages/search/index.tsx @@ -94,6 +94,7 @@ export async function getServerSideProps(ctx: GetServerSidePropsContext) { query: SEARCH_FORM_PARAMS_UNIT, variables: { publishedReservationUnits: true, + onlySeasonalBookable: true, }, }); diff --git a/apps/ui/pages/search/single.tsx b/apps/ui/pages/search/single.tsx index e3cdfd0d4c..11f30a26ff 100644 --- a/apps/ui/pages/search/single.tsx +++ b/apps/ui/pages/search/single.tsx @@ -114,6 +114,7 @@ export async function getServerSideProps(ctx: GetServerSidePropsContext) { query: SEARCH_FORM_PARAMS_UNIT, variables: { publishedReservationUnits: true, + onlyDirectBookable: true, }, });