From 187f3e8d33df9400fdf9cd219a3aa797e20c67bc Mon Sep 17 00:00:00 2001 From: Christophe Gerard Date: Tue, 1 Oct 2024 11:30:18 +0200 Subject: [PATCH] check if has geojson --- .../domains/assignments/hooks/requests/useGetOrgUnits.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hat/assets/js/apps/Iaso/domains/assignments/hooks/requests/useGetOrgUnits.ts b/hat/assets/js/apps/Iaso/domains/assignments/hooks/requests/useGetOrgUnits.ts index 7df2cb1367..2d0f5f7e27 100644 --- a/hat/assets/js/apps/Iaso/domains/assignments/hooks/requests/useGetOrgUnits.ts +++ b/hat/assets/js/apps/Iaso/domains/assignments/hooks/requests/useGetOrgUnits.ts @@ -9,10 +9,10 @@ import { makeUrlWithParams } from '../../../../libs/utils'; import { OrgUnit, PaginatedOrgUnits } from '../../../orgUnits/types/orgUnit'; -import { BaseLocation, Locations } from '../../types/locations'; import { Profile } from '../../../../utils/usersUtils'; -import { DropdownTeamsOptions } from '../../types/team'; import { AssignmentsApi } from '../../types/assigment'; +import { BaseLocation, Locations } from '../../types/locations'; +import { DropdownTeamsOptions } from '../../types/team'; import { getOrgUnitAssignation } from '../../utils'; @@ -57,7 +57,7 @@ const mapLocation = ({ }; if (!orgUnitParentIds.find(ou => ou === orgUnit.id)) { if (parseInt(baseOrgunitType, 10) === orgUnit.org_unit_type_id) { - if (orgUnit.geo_json) { + if (orgUnit.has_geo_json && orgUnit.geo_json) { const shape = { ...baseLocation, geoJson: orgUnit.geo_json,