4
4
SearchContentWithOptionsQuery ,
5
5
SearchOptions ,
6
6
useDeleteStoryMutation ,
7
- useProductAreasQuery ,
8
7
useTeamkatalogenQuery ,
9
8
} from '../../lib/schema/graphql'
10
9
import ErrorMessage from '../lib/error'
@@ -16,6 +15,7 @@ import { SearchParam } from '../../pages/search'
16
15
import { useRouter } from 'next/router'
17
16
import { USER_INFO } from '../../lib/queries/userInfo/userInfo'
18
17
import { UserState } from '../../lib/context'
18
+ import { useGetProductAreas } from '../../lib/rest/productAreas'
19
19
20
20
const Results = ( { children } : { children : React . ReactNode } ) => (
21
21
< div className = "results" > { children } </ div >
@@ -87,7 +87,7 @@ const ResultList = ({
87
87
variables : { q : '' } ,
88
88
} )
89
89
90
- const po = useProductAreasQuery ( )
90
+ const { productAreas } = useGetProductAreas ( )
91
91
const [ deleteStoryQuery ] = useDeleteStoryMutation ( )
92
92
const userInfo = useContext ( UserState )
93
93
const deleteStory = ( id : string ) => deleteStoryQuery ( {
@@ -150,7 +150,7 @@ const ResultList = ({
150
150
teamkatalogenURL : it . result . teamkatalogenURL ,
151
151
} }
152
152
teamkatalogen = { tk . data }
153
- productAreas = { po . data }
153
+ productAreas = { productAreas }
154
154
/>
155
155
)
156
156
)
@@ -170,7 +170,7 @@ const ResultList = ({
170
170
link = { `/dataproduct/${ d . result . id } /${ d . result . slug } ` }
171
171
datasets = { d . result . datasets }
172
172
teamkatalogen = { tk . data }
173
- productAreas = { po . data }
173
+ productAreas = { productAreas }
174
174
/>
175
175
)
176
176
) }
@@ -191,7 +191,7 @@ const ResultList = ({
191
191
keywords = { d . keywords }
192
192
link = { `/dataproduct/${ d . id } /${ d . slug } ` }
193
193
teamkatalogen = { tk . data }
194
- productAreas = { po . data }
194
+ productAreas = { productAreas }
195
195
/>
196
196
) ) }
197
197
</ Results >
@@ -214,7 +214,7 @@ const ResultList = ({
214
214
resourceType = { "datafortelling" }
215
215
link = { `/story/${ s . id } ` }
216
216
teamkatalogen = { tk . data }
217
- productAreas = { po . data }
217
+ productAreas = { productAreas }
218
218
keywords = { s . keywords }
219
219
editable = { true }
220
220
description = { s . description }
@@ -242,7 +242,7 @@ const ResultList = ({
242
242
name = { p . name }
243
243
link = { p . link }
244
244
teamkatalogen = { tk . data }
245
- productAreas = { po . data }
245
+ productAreas = { productAreas }
246
246
description = { p . description }
247
247
innsiktsproduktType = { p . type }
248
248
editable = { ! ! userInfo ?. googleGroups ?. find ( it => it . email == p . group ) }
0 commit comments