Skip to content

Commit 0d932f2

Browse files
refactor(revalidate): derive RevalidateTypes from VALID_REVALIDATE_TYPES using as const
Agent-Logs-Url: https://github.com/MobilityData/mobilitydatabase-web/sessions/abef6cf3-56bf-4193-98d6-be9048ca9b2f Co-authored-by: Alessandro100 <18631060+Alessandro100@users.noreply.github.com>
1 parent 18f2551 commit 0d932f2

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

src/app/api/revalidate/route.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,16 @@ import {
99
revalidateSpecificFeeds,
1010
} from '../../utils/revalidate-feeds';
1111

12-
type RevalidateTypes =
13-
| 'full'
14-
| 'all-feeds'
15-
| 'all-gbfs-feeds'
16-
| 'all-gtfs-rt-feeds'
17-
| 'all-gtfs-feeds'
18-
| 'specific-feeds';
19-
20-
const VALID_REVALIDATE_TYPES: RevalidateTypes[] = [
12+
const VALID_REVALIDATE_TYPES = [
2113
'full',
2214
'all-feeds',
2315
'all-gbfs-feeds',
2416
'all-gtfs-rt-feeds',
2517
'all-gtfs-feeds',
2618
'specific-feeds',
27-
];
19+
] as const;
20+
21+
type RevalidateTypes = (typeof VALID_REVALIDATE_TYPES)[number];
2822

2923
interface RevalidateBody {
3024
feedIds: string[]; // only for 'specific-feeds' revalidation type

0 commit comments

Comments
 (0)