diff --git a/server/infra/database/BoundsRepository.ts b/server/infra/database/BoundsRepository.ts index ecbbf9b..af4d002 100644 --- a/server/infra/database/BoundsRepository.ts +++ b/server/infra/database/BoundsRepository.ts @@ -47,7 +47,9 @@ export default class BoundsRepository { return BoundsRepository.convertStringToBounds(bounds); } - async filterByOrganisation(organisationId: string): Promise { + async filterByOrganisation( + organisationId: string[] | string, + ): Promise { const organisationBoundsSql = ` select ST_EXTENT(ST_GeomFromText('POINT(' || t.lon || ' ' || t.lat || ')', 4326)) as bounds diff --git a/server/interfaces/GrowerAccountFilter.ts b/server/interfaces/GrowerAccountFilter.ts index 42aabda..a5dd0ea 100644 --- a/server/interfaces/GrowerAccountFilter.ts +++ b/server/interfaces/GrowerAccountFilter.ts @@ -7,7 +7,7 @@ interface GrowerAccountFilter extends DbModel { limit?: number; offset?: number; keyword?: string; - organization_id?: string; + organization_id?: string[] | string; person_id?: string; device_identifier?: string; wallet?: string; diff --git a/server/models/Bounds.ts b/server/models/Bounds.ts index 051f7e3..5ae1689 100644 --- a/server/models/Bounds.ts +++ b/server/models/Bounds.ts @@ -5,7 +5,7 @@ import Bounds from 'interfaces/Bounds'; type BoundsFilter = Partial<{ planter_id: string; wallet_id: string; - organisation_id: string; + organisation_id: string[] | string; }>; function getByFilter(