Commit 0d1229b2 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

NORTH api baseURL fix.

parent e0378022
Pipeline #112160 passed with stages
in 26 minutes and 33 seconds
......@@ -23,13 +23,14 @@ import {
useRecoilState
} from 'recoil'
import PropTypes from 'prop-types'
import { apiBase, appBase } from '../config'
import { apiBase } from '../config'
import { makeStyles, Typography } from '@material-ui/core'
import LoginLogout from './LoginLogout'
import { useKeycloak } from 'react-keycloak'
import axios from 'axios'
import { useErrors } from './errors'
import * as searchQuantities from '../searchQuantities.json'
const apiBaseNORTH = `${apiBase.split('/').slice(0, -1).join('/')}/north`
export class DoesNotExist extends Error {
constructor(msg) {
......@@ -303,8 +304,8 @@ class Api {
const auth = await this.authHeaders()
try {
const result = await this.axios.get(
`${appBase}/north/tools/`,
auth
'/tools/',
{...auth, baseURL: apiBaseNORTH}
)
return result.data
} catch (errors) {
......@@ -320,8 +321,8 @@ class Api {
const auth = await this.authHeaders()
try {
const result = await this.axios.get(
`${appBase}/north/instances/`,
auth
'/instances/',
{...auth, baseURL: apiBaseNORTH}
)
return result.data
} catch (errors) {
......@@ -344,9 +345,9 @@ class Api {
}
try {
const result = await this.axios.post(
`${appBase}/north/instances/`,
'/instances/',
instance,
auth
{...auth, baseURL: apiBaseNORTH}
)
return result.data
} catch (errors) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment