Skip to content

Commit

Permalink
fix: juris matching logic adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinBuyck committed Nov 15, 2024
1 parent e3a77c5 commit bad853b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/src/services/listing.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,12 @@ export class ListingService implements OnModuleInit {
OR: userRolesWhere,
},
});

// account for users having access to multiple jurisdictions
const userWithJuris = userResults?.find(
(user) => user.jurisdictions.length,
const userWithJuris = userResults?.find((user) =>
user.jurisdictions.some((juris) => juris.id === jurisId),
);

const matchingJurisInfo = userWithJuris?.jurisdictions?.find(
(juris) => juris.id === jurisId,
);
Expand Down

0 comments on commit bad853b

Please sign in to comment.