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

View File

@ -7,6 +7,7 @@ import {
fetchBaseQuery, fetchBaseQuery,
} from '@reduxjs/toolkit/query/react'; } from '@reduxjs/toolkit/query/react';
import { $authToken, $baseUrl, $projectId } from 'services/api/client'; import { $authToken, $baseUrl, $projectId } from 'services/api/client';
import { undefined } from 'zod';
export const tagTypes = [ export const tagTypes = [
'Board', 'Board',
@ -29,6 +30,17 @@ const dynamicBaseQuery: BaseQueryFn<
FetchBaseQueryError FetchBaseQueryError
> = async (args, api, extraOptions) => { > = async (args, api, extraOptions) => {
const baseUrl = $baseUrl.get(); 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 authToken = $authToken.get();
const projectId = $projectId.get(); const projectId = $projectId.get();