Skip to content

Commit

Permalink
Fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
barbara-chaves committed Apr 4, 2024
1 parent e6d41a7 commit bede561
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions client/src/containers/countries/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ const useTableData = () => {

const countries = country
? [country, ...countriesComparison].sort((a, b) => {
if (!a || !b) return 0;
return a.localeCompare(b);
})
if (!a || !b) return 0;
return a.localeCompare(b);
})
: [];

const TABLE_COLUMNS_DATA = countries.map((c) => {
Expand Down Expand Up @@ -106,10 +106,10 @@ const useTableData = () => {
const isResource = attributes?.value_type === "resource";
const resources = isResource
? datasetValue?.attributes?.resources?.data?.reduce(
(acc: DatasetValueResourcesDataItemAttributes[], r) =>
r.attributes ? [...acc, r.attributes] : acc,
[],
)
(acc: DatasetValueResourcesDataItemAttributes[], r) =>
r.attributes ? [...acc, r.attributes] : acc,
[],
)
: undefined;

// If is not a resource dataset get the value
Expand All @@ -120,7 +120,8 @@ const useTableData = () => {
datasetValue?.attributes?.[valueType];
return {
iso3: c,
countryName: countriesData?.data?.find((c1) => c1.attributes?.iso3 === c)?.attributes?.name,
countryName: countriesData?.data?.find((c1) => c1.attributes?.iso3 === c)
?.attributes?.name,
isResource,
resources,
value,
Expand Down

0 comments on commit bede561

Please sign in to comment.