From 477f584e23a6dad8801df96fc98b13e2e049d39e Mon Sep 17 00:00:00 2001 From: Damon Ulmi <63123585+DamonU2@users.noreply.github.com> Date: Fri, 20 Sep 2024 12:09:59 -0700 Subject: [PATCH] fix(geocore): reponse > response (#2499) Closes #2485 Closes #2484 --- .../src/api/config/uuid-config-reader.ts | 8 ++++---- .../src/core/components/north-arrow/north-arrow.tsx | 2 +- .../core/utils/config/reader/uuid-config-reader.ts | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/geoview-core/src/api/config/uuid-config-reader.ts b/packages/geoview-core/src/api/config/uuid-config-reader.ts index abca74d9c07..910ad63d12e 100644 --- a/packages/geoview-core/src/api/config/uuid-config-reader.ts +++ b/packages/geoview-core/src/api/config/uuid-config-reader.ts @@ -42,15 +42,15 @@ export class UUIDmapConfigReader { */ static #getLayerConfigFromResponse(result: AxiosResponse, lang: string): TypeJsonObject[] { // If invalid response - if (!result?.data || !result.data.reponse || !result.data.reponse.rcs || !result.data.reponse.rcs[lang]) { + if (!result?.data || !result.data.response || !result.data.response.rcs || !result.data.response.rcs[lang]) { const errorMessage = result?.data?.errorMessage || ''; throw new Error(`Invalid response from GeoCore service\n${errorMessage}\n`); } - if (result.data.reponse.rcs[lang].length === 0) throw new Error('No layers returned by GeoCore service'); + if (result.data.response.rcs[lang].length === 0) throw new Error('No layers returned by GeoCore service'); const listOfGeoviewLayerConfig: TypeJsonObject[] = []; - for (let i = 0; i < (result.data.reponse.rcs[lang] as TypeJsonArray).length; i++) { - const data = result.data.reponse.rcs[lang][i]; + for (let i = 0; i < (result.data.response.rcs[lang] as TypeJsonArray).length; i++) { + const data = result.data.response.rcs[lang][i]; if (data?.layers && (data.layers as TypeJsonArray).length > 0) { const layer = data.layers[0]; diff --git a/packages/geoview-core/src/core/components/north-arrow/north-arrow.tsx b/packages/geoview-core/src/core/components/north-arrow/north-arrow.tsx index 9bcfc84115b..d381560ce44 100644 --- a/packages/geoview-core/src/core/components/north-arrow/north-arrow.tsx +++ b/packages/geoview-core/src/core/components/north-arrow/north-arrow.tsx @@ -33,7 +33,7 @@ export function NorthArrow(): JSX.Element { const { rotationAngle, northOffset } = useManageArrow(); - return `EPSG:${mapProjection}` === Projection.PROJECTION_NAMES.LCC || `EPSG:${mapProjection}` !== Projection.PROJECTION_NAMES.WM ? ( + return `EPSG:${mapProjection}` === Projection.PROJECTION_NAMES.LCC || `EPSG:${mapProjection}` === Projection.PROJECTION_NAMES.WM ? ( , lang: string): TypeGeoviewLayerConfig[] { // If invalid response - if (!result?.data || !result.data.reponse || !result.data.reponse.rcs || !result.data.reponse.rcs[lang]) + if (!result?.data || !result.data.response || !result.data.response.rcs || !result.data.response.rcs[lang]) throw new Error('Invalid response from GeoCore service'); - if (result.data.reponse.rcs[lang].length === 0) throw new Error('No layers returned by GeoCore service'); + if (result.data.response.rcs[lang].length === 0) throw new Error('No layers returned by GeoCore service'); const listOfGeoviewLayerConfig: TypeGeoviewLayerConfig[] = []; - for (let i = 0; i < (result.data.reponse.rcs[lang] as TypeJsonArray).length; i++) { - const data = result.data.reponse.rcs[lang][i]; + for (let i = 0; i < (result.data.response.rcs[lang] as TypeJsonArray).length; i++) { + const data = result.data.response.rcs[lang][i]; if (data?.layers && (data.layers as TypeJsonArray).length > 0) { const layer = data.layers[0]; @@ -381,10 +381,10 @@ export class UUIDmapConfigReader { */ static #getGeoChartConfigFromResponse(result: AxiosResponse, lang: string): GeoChartConfig[] { // If no geochart information - if (!result?.data || !result.data.reponse || !result.data.reponse.gcs || !Array.isArray(result.data.reponse.gcs)) return []; + if (!result?.data || !result.data.response || !result.data.response.gcs || !Array.isArray(result.data.response.gcs)) return []; // Find all Geochart configs - const foundConfigs = result.data.reponse.gcs + const foundConfigs = result.data.response.gcs .map((gcs) => gcs?.[lang]?.packages?.geochart as GeoChartGeoCoreConfig) .filter((geochartValue) => !!geochartValue);