Skip to content

Commit

Permalink
Update new session link to use base url (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
bedanley authored Jan 21, 2025
1 parent ad47d26 commit 30632b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/user-interface/react/src/components/chatbot/Sessions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ import {
sessionApi,
useDeleteAllSessionsForUserMutation,
useDeleteSessionByIdMutation,
useListSessionsQuery
useListSessionsQuery,
} from '../../shared/reducers/session.reducer';
import { useAppDispatch } from '../../config/store';
import { useNotificationService } from '../../shared/util/hooks';
import { useEffect, useState } from 'react';
import { useAuth } from 'react-oidc-context';
import { IConfiguration } from '../../shared/model/configuration.model';
import { getBaseURI } from '../utils';

export function Sessions () {
const dispatch = useAppDispatch();
Expand Down Expand Up @@ -118,7 +119,8 @@ export function Sessions () {
{
id: 'title',
header: 'Title',
cell: (e) => <Link variant='primary' href={`#/chatbot/${e.sessionId}`}>{e.history[0].content || 'No Content'}</Link>,
cell: (e) => <Link variant='primary'
href={`${getBaseURI()}#/chatbot/${e.sessionId}`}>{e.history[0].content || 'No Content'}</Link>,
sortingField: 'title',
isRowHeader: true,
},
Expand All @@ -138,7 +140,7 @@ export function Sessions () {
<div className='mr-10'>
<SpaceBetween direction='horizontal' size='m'>
<Button iconName='add-plus' variant='inline-link'>
<Link href={`/#/chatbot/${uuidv4()}`}>New</Link>
<Link href={`${getBaseURI()}#/chatbot/${uuidv4()}`}>New</Link>
</Button>
<Button
iconAlt='Refresh list'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
*/

import { default as Axios, AxiosError, AxiosRequestConfig } from 'axios';
import { getBaseURI } from '../../components/utils';

export const lisaAxios = Axios.create({
baseURL: `${window.env.API_BASE_URL}`,
baseURL: getBaseURI(),
});

lisaAxios.interceptors.request.use(
Expand Down

0 comments on commit 30632b2

Please sign in to comment.