Skip to content

Commit

Permalink
fixed filter causing missing assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
markdturner committed Sep 7, 2024
1 parent 28327ed commit 9d86f11
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions src/api/timesheet/services/timesheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,16 +388,25 @@ module.exports = ({ strapi }) => ({
}
},
{
end: {
$null: true
}
$and: [
{
start: {
$lt: startDate.toISODate()
},
},
{
end: {
$gt: endDate.toISODate()
}
}
]
}
]
}

const timesheets = await strapi.services['api::timesheet.timesheet'].find(...args),
assignments = await strapi.services['api::assignment.assignment'].find({filters: dateRangeFilter}),
capacities = await strapi.services['api::capacity.capacity'].find({filters: dateRangeFilter}),
capacities = await strapi.services['api::capacity.capacity'].find({filters: { $or: [...dateRangeFilter.$or, { end: { $null: true }} ]} }),
holidays = await fetchBankHolidays(args[0].filters.year.$eq),
annualLeave = await strapi.services['api::timesheet.timesheet'].leave({...args[0]})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"x-generation-date": "2024-09-05T07:36:38.358Z"
"x-generation-date": "2024-09-07T22:21:39.958Z"
},
"x-strapi-config": {
"path": "/documentation",
Expand Down

0 comments on commit 9d86f11

Please sign in to comment.