Skip to content

Commit 0e00547

Browse files
committed
Oppdatert kall til nom-proxy
1 parent 7c6f19a commit 0e00547

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

apps/dolly-frontend/src/main/js/src/api/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ type Config = {
173173
const _fetch = (url: string, config: Config, body?: object): Promise<Response> =>
174174
fetchRetry(url, {
175175
retryOn: (attempt, error, response) => {
176-
console.log('response: ', response) //TODO - SLETT MEG
177176
if (
178177
!response?.ok &&
179178
response?.status !== 404 &&

apps/dolly-frontend/src/main/js/src/utils/hooks/useNom.tsx

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
11
import useSWR from 'swr'
2-
import api, { fetcher } from '@/api'
2+
import axios from 'axios'
33

44
const baseUrl = '/testnav-nom-proxy'
55

66
export const useNomData = (ident: any) => {
77
const { data, isLoading, error } = useSWR<any, Error>(
88
ident ? `${baseUrl}/api/v1/dolly/hentRessurs` : null,
9-
// (url) => fetcher(url, { method: 'POST', params: { ident } }),
10-
(url) => {
11-
return api
12-
.fetchJson(
13-
url,
14-
{
15-
method: 'POST',
16-
headers: {
17-
'Content-Type': 'application/json',
18-
},
19-
},
20-
ident,
21-
)
22-
.then((response: any) => ({ data: response }))
9+
async (url) => {
10+
const res = await axios.post(url, ident, {
11+
headers: {
12+
'Content-Type': 'text/plain',
13+
},
14+
})
15+
return res.data
2316
},
2417
)
18+
2519
return {
2620
nomData: data,
2721
loading: isLoading,

0 commit comments

Comments
 (0)