From 43599d55a9dcbe09274ab75e93e5a42a6d7d0ceb Mon Sep 17 00:00:00 2001 From: Meghna Holla Date: Wed, 18 Dec 2024 10:59:30 -0800 Subject: [PATCH] move geo type to sharedAPI constants, remove unused activity type from constants --- api/src/constants.ts | 9 --------- api/src/constants/misc.ts | 12 ------------ api/src/utils/kml-import.ts | 2 +- sharedAPI/src/validation/constants.ts | 10 ++++++++++ 4 files changed, 11 insertions(+), 22 deletions(-) delete mode 100644 api/src/constants.ts diff --git a/api/src/constants.ts b/api/src/constants.ts deleted file mode 100644 index 6859f749c..000000000 --- a/api/src/constants.ts +++ /dev/null @@ -1,9 +0,0 @@ -export const VALID_GEOMETRY_TYPES = [ - 'GeometryCollection', - 'MultiPolygon', - 'MultiLineString', - 'MultiPoint', - 'Polygon', - 'LineString', - 'Point' -]; diff --git a/api/src/constants/misc.ts b/api/src/constants/misc.ts index 699cd4b8f..17b6a0c9b 100644 --- a/api/src/constants/misc.ts +++ b/api/src/constants/misc.ts @@ -52,18 +52,6 @@ export const ALL_ROLES = [ Role.PRIMARY_BIOCONTROL_USER ]; -/** - * Supported activity types. - * - * @export - * @enum {number} - */ -export enum ActivityType { - OBSERVATION = 'Observation', - MONITOR = 'Monitor', - TREATMENT = 'Treatment' -} - /** * Some of the S3 ACL roles supported by default. * diff --git a/api/src/utils/kml-import.ts b/api/src/utils/kml-import.ts index 6e1f8d58d..c1663f5c8 100644 --- a/api/src/utils/kml-import.ts +++ b/api/src/utils/kml-import.ts @@ -3,7 +3,7 @@ import * as GeoJSON from '@mapbox/togeojson'; import AdmZip from 'adm-zip'; import { FeatureCollection } from 'geojson'; import { getLogger } from 'utils/logger'; -import { VALID_GEOMETRY_TYPES } from 'constants'; +import { VALID_GEOMETRY_TYPES } from 'sharedAPI'; function KMZToKML(data: Buffer): Buffer { const log = getLogger('KML'); diff --git a/sharedAPI/src/validation/constants.ts b/sharedAPI/src/validation/constants.ts index 6d2b7043b..e86dec943 100644 --- a/sharedAPI/src/validation/constants.ts +++ b/sharedAPI/src/validation/constants.ts @@ -22,3 +22,13 @@ export const FORM_SUBTYPES_WITH_AREA_LIMITS = [ 'Activity_Transect_BiocontrolEfficacy', 'Activity_Biocontrol_Collection' ]; + +export const VALID_GEOMETRY_TYPES = [ + 'GeometryCollection', + 'MultiPolygon', + 'MultiLineString', + 'MultiPoint', + 'Polygon', + 'LineString', + 'Point' +];