diff --git a/src/api/index.js b/src/api/index.js index c7b1856db..cfa552b98 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -57,7 +57,7 @@ export async function getInstallProperties() { try { data = await get(uri); } catch (error) { - if (error?.response?.data?.status === 404) { + if (error?.response?.status === 404) { data = { dashboardNamespace: 'N/A', dashboardVersion: 'kubectl-proxy-client', diff --git a/src/api/index.test.js b/src/api/index.test.js index 999fcb7e4..11b1994aa 100644 --- a/src/api/index.test.js +++ b/src/api/index.test.js @@ -447,9 +447,7 @@ describe('getInstallProperties', () => { it('handles error in case of Dashboard client mode', async () => { const error = new Error(); error.response = { - data: { - status: 404 - } + status: 404 }; fetchMock.get(/properties/, { throws: error }); const properties = await API.getInstallProperties();