diff --git a/src/apps/dashboard/features/logs/api/useServerLog.ts b/src/apps/dashboard/features/logs/api/useServerLog.ts index 21b2d10057..8adc37b501 100644 --- a/src/apps/dashboard/features/logs/api/useServerLog.ts +++ b/src/apps/dashboard/features/logs/api/useServerLog.ts @@ -12,7 +12,13 @@ const fetchServerLog = async ( const response = await getSystemApi(api).getLogFile({ name }, options); // FIXME: TypeScript SDK thinks it is returning a File but in reality it is a string - return response.data as never as string; + const data = response.data as never as string | object; + + if (typeof data === 'object') { + return JSON.stringify(data, null, 2); + } else { + return data; + } }; export const useServerLog = (name: string) => { const { api } = useApi();