Skip to content

Commit

Permalink
Merge pull request #363 from SuspenseFallback/fix-organisation-error
Browse files Browse the repository at this point in the history
fix: added new type allowance for organization_id
  • Loading branch information
dadiorchen authored Oct 21, 2023
2 parents 0db3a50 + 494e17b commit e258ec9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion server/infra/database/BoundsRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export default class BoundsRepository {
return BoundsRepository.convertStringToBounds(bounds);
}

async filterByOrganisation(organisationId: string): Promise<Bounds> {
async filterByOrganisation(
organisationId: string[] | string,
): Promise<Bounds> {
const organisationBoundsSql = `
select
ST_EXTENT(ST_GeomFromText('POINT(' || t.lon || ' ' || t.lat || ')', 4326)) as bounds
Expand Down
2 changes: 1 addition & 1 deletion server/interfaces/GrowerAccountFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion server/models/Bounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit e258ec9

Please sign in to comment.