Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 0a1bd90

Browse files
committed
fix: search reservation type filter not working
1 parent 5e5085b commit 0a1bd90

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

apps/ui/components/search/SeasonalSearchForm.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const filterOrder = [
133133
"textSearch",
134134
"minPersons",
135135
"maxPersons",
136-
"reservationUnitType",
136+
"reservationUnitTypes",
137137
"unit",
138138
"purposes",
139139
];
@@ -155,7 +155,7 @@ function mapQueryToForm(query: ParsedUrlQuery): FormValues {
155155
unit: mapSingleParamToFormValue(query.unit) ?? "",
156156
purposes: mapSingleParamToFormValue(query.purposes) ?? "",
157157
reservationUnitTypes:
158-
mapSingleParamToFormValue(query.reservationUnitType) ?? "",
158+
mapSingleParamToFormValue(query.reservationUnitTypes) ?? "",
159159
minPersons: mapQueryParamToNumber(query.minPersons) ?? null,
160160
maxPersons: mapQueryParamToNumber(query.maxPersons) ?? null,
161161
textSearch: mapSingleParamToFormValue(query.textSearch) ?? "",
@@ -198,7 +198,7 @@ export function SeasonalSearchForm({
198198
switch (key) {
199199
case "unit":
200200
return unitOptions.find((n) => String(n.value) === value)?.label;
201-
case "reservationUnitType":
201+
case "reservationUnitTypes":
202202
return reservationUnitTypeOptions.find((n) => String(n.value) === value)
203203
?.label;
204204
case "purposes":
@@ -208,7 +208,7 @@ export function SeasonalSearchForm({
208208
}
209209
};
210210

211-
const multiSelectFilters = ["unit", "reservationUnitType", "purposes"];
211+
const multiSelectFilters = ["unit", "reservationUnitTypes", "purposes"];
212212
const hideList = ["applicationRound", "order", "sort"];
213213

214214
return (

apps/ui/components/search/SingleSearchForm.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ function mapQueryToForm(query: ParsedUrlQuery): FormValues {
177177
unit: mapSingleParamToFormValue(query.unit) ?? "",
178178
equipments: mapSingleParamToFormValue(query.equipments) ?? "",
179179
reservationUnitTypes:
180-
mapSingleParamToFormValue(query.reservationUnitType) ?? "",
180+
mapSingleParamToFormValue(query.reservationUnitTypes) ?? "",
181181
// ?
182182
timeBegin: mapSingleParamToFormValue(query.timeBegin) ?? null,
183183
timeEnd: mapSingleParamToFormValue(query.timeEnd) ?? null,
@@ -202,14 +202,14 @@ const filterOrder = [
202202
"duration",
203203
"minPersons",
204204
"maxPersons",
205-
"reservationUnitType",
205+
"reservationUnitTypes",
206206
"unit",
207207
"purposes",
208208
"equipments",
209209
];
210210
const multiSelectFilters = [
211211
"unit",
212-
"reservationUnitType",
212+
"reservationUnitTypes",
213213
"purposes",
214214
"equipments",
215215
];
@@ -252,7 +252,7 @@ export function SingleSearchForm({
252252
switch (key) {
253253
case "unit":
254254
return unitOptions.find((n) => compFn(n, value))?.label;
255-
case "reservationUnitType":
255+
case "reservationUnitTypes":
256256
return unitTypeOptions.find((n) => n.value === value)?.label;
257257
case "purposes":
258258
return purposeOptions.find((n) => n.value === value)?.label;

apps/ui/modules/search.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ export function processVariables(
156156
unit: paramToIntegers(values.unit),
157157
}
158158
: {}),
159-
...(values.reservationUnitType != null
159+
...(values.reservationUnitTypes != null
160160
? {
161-
reservationUnitType: paramToIntegers(values.reservationUnitType),
161+
reservationUnitType: paramToIntegers(values.reservationUnitTypes),
162162
}
163163
: {}),
164164
...(values.equipments != null

0 commit comments

Comments
 (0)