diff --git a/ui/react-app/src/utils/url-builder.ts b/ui/react-app/src/utils/url-builder.ts index adb8d101..c724f6fa 100644 --- a/ui/react-app/src/utils/url-builder.ts +++ b/ui/react-app/src/utils/url-builder.ts @@ -1,4 +1,4 @@ -const apiPrefix = '/api/v2'; +const API_PREFIX = '/api/v2'; export type URLParams = { resource: string; @@ -6,12 +6,10 @@ export type URLParams = { apiPrefix?: string; }; -export default function buildURL(params: URLParams): string { - let url = params.apiPrefix === undefined ? apiPrefix : params.apiPrefix; - url = `${url}/${params.resource}`; - - if (params.queryParams !== undefined) { - url = `${url}?${params.queryParams.toString()}`; +export default function buildURL({ apiPrefix = API_PREFIX, resource, queryParams }: URLParams): string { + let url = `${apiPrefix}/${resource}`; + if (queryParams !== undefined) { + url = `${url}?${queryParams.toString()}`; } return url; } diff --git a/ui/react-app/src/views/ViewStatus.tsx b/ui/react-app/src/views/ViewStatus.tsx index b3357428..f1e166db 100644 --- a/ui/react-app/src/views/ViewStatus.tsx +++ b/ui/react-app/src/views/ViewStatus.tsx @@ -45,7 +45,7 @@ function CustomTableCell(props: tableCellProperties) { export default function ViewStatus() { const { data } = useAMStatus(); if (data === undefined || data === null) { - return <>; + return null; } return (