File tree 3 files changed +11
-5
lines changed
3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -12,5 +12,5 @@ export const useInnsendingsytelseName = (innsendingsytelse: Innsendingsytelse):
12
12
return [ common . loading , true ] ;
13
13
}
14
14
15
- return [ data [ innsendingsytelse ] ?? innsendingsytelse , false ] ;
15
+ return [ data . find ( ( { id } ) => id === innsendingsytelse ) ?. navn ?? innsendingsytelse , false ] ;
16
16
} ;
Original file line number Diff line number Diff line change @@ -73,3 +73,6 @@ const staggeredBaseQuery = (baseUrl: string) => {
73
73
74
74
export const API_PATH = '/api/klage-dittnav-api/api' ;
75
75
export const API_BASE_QUERY = staggeredBaseQuery ( API_PATH ) ;
76
+
77
+ export const KODEVERK_API_PATH = '/api/klage-kodeverk-api/kodeverk' ;
78
+ export const KODEVERK_API_BASE_QUERY = staggeredBaseQuery ( KODEVERK_API_PATH ) ;
Original file line number Diff line number Diff line change 1
1
import type { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser' ;
2
2
import type { Languages } from '@app/language/types' ;
3
3
import { createApi } from '@reduxjs/toolkit/query/react' ;
4
- import { API_BASE_QUERY } from './common' ;
4
+ import { KODEVERK_API_BASE_QUERY } from './common' ;
5
5
6
- type InnsendingsytelserMap = Record < Innsendingsytelse , string > ;
6
+ interface InnsendingsytelseName {
7
+ id : Innsendingsytelse ;
8
+ navn : string ;
9
+ }
7
10
8
11
export const innsendingsytelserApi = createApi ( {
9
12
reducerPath : 'innsendingsytelserApi' ,
10
- baseQuery : API_BASE_QUERY ,
13
+ baseQuery : KODEVERK_API_BASE_QUERY ,
11
14
endpoints : ( builder ) => ( {
12
- getInnsendingsytelser : builder . query < InnsendingsytelserMap , Languages > ( {
15
+ getInnsendingsytelser : builder . query < InnsendingsytelseName [ ] , Languages > ( {
13
16
query : ( lang ) => `/innsendingsytelser/${ lang } ` ,
14
17
} ) ,
15
18
} ) ,
You can’t perform that action at this time.
0 commit comments