File tree Expand file tree Collapse file tree 3 files changed +15
-32
lines changed
components/stop-registry/search Expand file tree Collapse file tree 3 files changed +15
-32
lines changed Original file line number Diff line number Diff line change 11import isEmpty from 'lodash/isEmpty' ;
22import { StopsDatabaseQuayNewestVersionBoolExp } from '../../../../generated/graphql' ;
3- import {
4- StopRegistryMunicipality ,
5- knownPriorityValues ,
6- } from '../../../../types/enums' ;
3+ import { knownPriorityValues } from '../../../../types/enums' ;
74import {
85 AllOptionEnum ,
96 NullOptionEnum ,
@@ -63,15 +60,8 @@ function buildSearchStopsMunicipalityFilter({
6360
6461 return {
6562 stop_place : {
66- topographic_place_id : {
67- _in : municipalities . map (
68- ( name ) =>
69- (
70- StopRegistryMunicipality as unknown as Readonly <
71- Record < StringMunicipality , number >
72- >
73- ) [ name as StringMunicipality ] ,
74- ) ,
63+ topographic_place : {
64+ name_value : { _in : municipalities } ,
7565 } ,
7666 } ,
7767 } ;
Original file line number Diff line number Diff line change 1- import { StopRegistryMunicipality } from '../../../../types/enums' ;
2- import { numberEnumKeys } from '../../../../utils' ;
1+ export const knownMunicipalities = [
2+ 'Helsinki' ,
3+ 'Vantaa' ,
4+ 'Espoo' ,
5+ 'Kauniainen' ,
6+ 'Siuntio' ,
7+ 'Kirkkonummi' ,
8+ 'Sipoo' ,
9+ 'Kerava' ,
10+ 'Tuusula' ,
11+ ] as const ;
312
4- export const knownMunicipalities = Object . freeze (
5- numberEnumKeys ( StopRegistryMunicipality ) ,
6- ) ;
7-
8- export type StringMunicipality = keyof typeof StopRegistryMunicipality ;
13+ export type StringMunicipality = ( typeof knownMunicipalities ) [ number ] ;
Original file line number Diff line number Diff line change @@ -72,18 +72,6 @@ export enum DayType {
7272 SU = 9 , // Sunday
7373}
7474
75- export enum StopRegistryMunicipality {
76- Helsinki = 3 ,
77- Vantaa = 4 ,
78- Espoo = 5 ,
79- Kauniainen = 6 ,
80- Siuntio = 7 ,
81- Kirkkonummi = 8 ,
82- Sipoo = 9 ,
83- Kerava = 10 ,
84- Tuusula = 11 ,
85- }
86-
8775export const knownMunicipalityPrefixes = {
8876 Helsinki : 'H' ,
8977 Vantaa : 'V' ,
You can’t perform that action at this time.
0 commit comments