Skip to content

Commit 03dfb19

Browse files
committed
Type fix
1 parent aa186ec commit 03dfb19

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

app/src/views/AllSurgeAlerts/index.tsx

Lines changed: 8 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,9 @@ export function Component() {
191187
offset,
192188
event: eventFilter,
193189
country: countryFilter,
190+
// NOTE: not in OpenAPI schema; backend supports it
194191
message__icontains: positionFilter,
195192
molnix_tag_name: keywordsFilter,
196-
197193
// FIXME: this should come from the useFilterState
198194
ordering: 'molnix_status,-opens',
199195
},
@@ -324,6 +320,7 @@ export function Component() {
324320
{
325321
event: eventFilter,
326322
country: countryFilter,
323+
// NOTE: not in OpenAPI schema; backend supports it
327324
message__icontains: positionFilter,
328325
molnix_tag_name: keywordsFilter,
329326
ordering: 'molnix_status,-opens',

0 commit comments

Comments
 (0)