Skip to content

Commit 08245ba

Browse files
committed
Type fix
1 parent aa186ec commit 08245ba

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

app/src/views/AllSurgeAlerts/index.tsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,30 +114,26 @@ export function Component() {
114114

115115
const [positionFilter, setPositionFilter] = useUrlSearchState<string | undefined>(
116116
'position',
117-
(searchValue: string | undefined) => {
118-
const potentialValue = isDefined(searchValue)
119-
? String(searchValue)
120-
: undefined;
117+
(value) => {
118+
const potentialValue = isDefined(value) ? String(value) : undefined;
121119
if (isDefined(potentialValue)) {
122120
setPage(0);
123121
}
124122
return potentialValue;
125123
},
126-
(position: string | undefined) => position,
124+
(position) => position,
127125
);
128126

129127
const [keywordsFilter, setKeywordsFilter] = useUrlSearchState<string | undefined>(
130128
'keywords',
131-
(searchValue: string | undefined) => {
132-
const potentialValue = isDefined(searchValue)
133-
? String(searchValue)
134-
: undefined;
129+
(value) => {
130+
const potentialValue = isDefined(value) ? String(value) : undefined;
135131
if (isDefined(potentialValue)) {
136132
setPage(0);
137133
}
138134
return potentialValue;
139135
},
140-
(keywords: string | undefined) => keywords,
136+
(keywords) => keywords,
141137
);
142138

143139
useRequest({
@@ -191,9 +187,10 @@ export function Component() {
191187
offset,
192188
event: eventFilter,
193189
country: countryFilter,
190+
// NOTE: not in OpenAPI schema; backend supports it
191+
// @ts-expect-error: extra query param not generated
194192
message__icontains: positionFilter,
195193
molnix_tag_name: keywordsFilter,
196-
197194
// FIXME: this should come from the useFilterState
198195
ordering: 'molnix_status,-opens',
199196
},
@@ -324,6 +321,8 @@ export function Component() {
324321
{
325322
event: eventFilter,
326323
country: countryFilter,
324+
// NOTE: not in OpenAPI schema; backend supports it
325+
// @ts-expect-error: extra query param not generated
327326
message__icontains: positionFilter,
328327
molnix_tag_name: keywordsFilter,
329328
ordering: 'molnix_status,-opens',

0 commit comments

Comments
 (0)