File tree Expand file tree Collapse file tree 2 files changed +9
-16
lines changed
apps/dolly-frontend/src/main/js/src Expand file tree Collapse file tree 2 files changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -173,7 +173,6 @@ type Config = {
173
173
const _fetch = ( url : string , config : Config , body ?: object ) : Promise < Response > =>
174
174
fetchRetry ( url , {
175
175
retryOn : ( attempt , error , response ) => {
176
- console . log ( 'response: ' , response ) //TODO - SLETT MEG
177
176
if (
178
177
! response ?. ok &&
179
178
response ?. status !== 404 &&
Original file line number Diff line number Diff line change 1
1
import useSWR from 'swr'
2
- import api , { fetcher } from '@/api '
2
+ import axios from 'axios '
3
3
4
4
const baseUrl = '/testnav-nom-proxy'
5
5
6
6
export const useNomData = ( ident : any ) => {
7
7
const { data, isLoading, error } = useSWR < any , Error > (
8
8
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
23
16
} ,
24
17
)
18
+
25
19
return {
26
20
nomData : data ,
27
21
loading : isLoading ,
You can’t perform that action at this time.
0 commit comments