Skip to content

Commit

Permalink
[Release] Version 0.0.5 (#257)
Browse files Browse the repository at this point in the history
* [Fix] Show applicants even if they do not have an active permit ([Fix] Show applicants even if they do not have an active permit #256)
  • Loading branch information
OustanDing committed Aug 16, 2022
1 parent af8bd26 commit 6c854d8
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions lib/applicants/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,25 +147,27 @@ export const applicants: Resolver<

// Permit status and expiry date range filters both look at the permit expiryDate.
// For this reason we need to filter on expiryDate twice to take both filters in account.
const permitFilter = {
some: {
AND: [
{
expiryDate: {
gte: expiryDateLowerBound?.toISOString(),
lte: expiryDateUpperBound?.toISOString(),
const permitFilter =
expiryDateLowerBound || expiryDateUpperBound || expiryDateRangeFrom || expiryDateRangeTo
? {
some: {
AND: [
{
expiryDate: {
gte: expiryDateLowerBound?.toISOString(),
lte: expiryDateUpperBound?.toISOString(),
},
},
{
expiryDate: {
gte: expiryDateRangeFrom?.toISOString(),
lte: expiryDateRangeTo?.toISOString(),
},
},
],
},
},
{
expiryDate: {
gte: expiryDateRangeFrom?.toISOString(),
lte: expiryDateRangeTo?.toISOString(),
},
},
{ active: true },
],
},
};
}
: undefined;

// Update default filter since there were filter arguments
where = {
Expand Down

0 comments on commit 6c854d8

Please sign in to comment.