add logging

This commit is contained in:
Mary Hipp 2023-08-25 14:06:18 -04:00
parent bc585ba964
commit 56d56b5018
2 changed files with 14 additions and 0 deletions

View File

@ -39,6 +39,7 @@ const InvokeAIUI = ({
}: Props) => {
const [isReady, setIsReady] = useState(false);
useEffect(() => {
console.log({ apiUrl });
if (token && apiUrl && projectId) {
$authToken.set(token);
$baseUrl.set(apiUrl);
@ -49,6 +50,7 @@ const InvokeAIUI = ({
$baseUrl.set(apiUrl);
setIsReady(true);
} else {
$baseUrl.set('');
setIsReady(true);
}

View File

@ -7,6 +7,7 @@ import {
fetchBaseQuery,
} from '@reduxjs/toolkit/query/react';
import { $authToken, $baseUrl, $projectId } from 'services/api/client';
import { undefined } from 'zod';
export const tagTypes = [
'Board',
@ -29,6 +30,17 @@ const dynamicBaseQuery: BaseQueryFn<
FetchBaseQueryError
> = async (args, api, extraOptions) => {
const baseUrl = $baseUrl.get();
console.log({ baseUrl })
if (baseUrl === undefined) {
return {
error: {
status: 400,
statusText: 'Bad Request',
data: 'No baseUrl set',
},
}
}
const authToken = $authToken.get();
const projectId = $projectId.get();