Skip to content

Commit

Permalink
fix(geocore): reponse > response (#2499)
Browse files Browse the repository at this point in the history
Closes #2485
Closes #2484
  • Loading branch information
DamonU2 authored Sep 20, 2024
1 parent e157c28 commit 477f584
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions packages/geoview-core/src/api/config/uuid-config-reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ export class UUIDmapConfigReader {
*/
static #getLayerConfigFromResponse(result: AxiosResponse<TypeJsonObject>, 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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? (
<Box
ref={northArrowRef}
sx={sxClasses.northArrowContainer}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ export class UUIDmapConfigReader {
*/
static #getLayerConfigFromResponse(result: AxiosResponse<TypeJsonObject>, 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];
Expand Down Expand Up @@ -381,10 +381,10 @@ export class UUIDmapConfigReader {
*/
static #getGeoChartConfigFromResponse(result: AxiosResponse<GeoChartGeoCoreConfig>, 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);

Expand Down

0 comments on commit 477f584

Please sign in to comment.