Skip to content

Commit 843d836

Browse files
committed
pr comments
1 parent 3e1b768 commit 843d836

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

web-app/src/app/screens/Feeds/utility.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,13 @@ describe('utility.ts', () => {
115115

116116
test('filters to allowed values', () => {
117117
expect(
118-
parseQueryParamStatus(['active', 'deprecated', 'inactive', 'future']),
118+
parseQueryParamStatus([
119+
'active',
120+
'deprecated',
121+
'inactive',
122+
'future',
123+
'development',
124+
]),
119125
).toEqual(['active', 'inactive', 'future']);
120126
});
121127

web-app/src/app/screens/Feeds/utility.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
export type AllowedFeedSearchStatus = 'active' | 'inactive' | 'future';
1+
const ALLOWED_FEED_STATUSES = ['active', 'inactive', 'future'] as const;
2+
export type AllowedFeedSearchStatus = (typeof ALLOWED_FEED_STATUSES)[number];
23

34
export function getDataTypeParamFromSelectedFeedTypes(
45
selectedFeedTypes: Record<string, boolean>,
@@ -48,6 +49,6 @@ export const parseQueryParamStatus = (
4849
queryStatus: string[] | undefined,
4950
): AllowedFeedSearchStatus[] => {
5051
return (queryStatus?.filter((s) =>
51-
['active', 'inactive', 'future'].includes(s),
52+
ALLOWED_FEED_STATUSES.includes(s as AllowedFeedSearchStatus),
5253
) ?? []) as AllowedFeedSearchStatus[];
5354
};

0 commit comments

Comments
 (0)