diff --git a/src/api/rse/services/rse.js b/src/api/rse/services/rse.js index 1f2d260..3fbfe40 100644 --- a/src/api/rse/services/rse.js +++ b/src/api/rse/services/rse.js @@ -19,7 +19,7 @@ function createCalendar(rse, holidays, leave, assignments, capacities, timesheet currentAssignments = assignments.filter(assignment => { const start = DateTime.fromISO(assignment.start), end = DateTime.fromISO(assignment.end) - return date >= start && date <= end && assignment.rse === rse.id + return date >= start && date <= end && assignment.rse.id === rse.id }) let dateCapacity = 0 @@ -78,7 +78,7 @@ function createCalendar(rse, holidays, leave, assignments, capacities, timesheet duration: leaveDay.DURATION === 'Y' ? 7.4 : 3.7, status: leaveDay.STATUS } : null, - assignments: currentAssignments, + assignments: currentAssignments.map(({ rse, ...assignment }) => assignment), timesheet: timesheetSummary } @@ -304,7 +304,7 @@ module.exports = createCoreService("api::rse.rse", ({ strapi }) => ({ year: { $eq: year } } - let assignments = await strapi.service("api::assignment.assignment").find({filters: dateRangeFilter, populate: { project: { fields: ['name'] } } }), + let assignments = await strapi.service("api::assignment.assignment").find({filters: dateRangeFilter, populate: { rse: { fields: ['id'] }, project: { fields: ['name'] } } }), capacities = await strapi.service("api::capacity.capacity").find({filters: dateRangeFilter}), holidays = await fetchBankHolidays(year), leave = await strapi.service("api::timesheet.timesheet").findLeave({filters: yearFilter}), diff --git a/src/extensions/documentation/documentation/1.0.0/full_documentation.json b/src/extensions/documentation/documentation/1.0.0/full_documentation.json index 228e78b..29da5d7 100644 --- a/src/extensions/documentation/documentation/1.0.0/full_documentation.json +++ b/src/extensions/documentation/documentation/1.0.0/full_documentation.json @@ -14,7 +14,7 @@ "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" }, - "x-generation-date": "2024-08-27T19:53:43.872Z" + "x-generation-date": "2024-08-27T20:09:29.319Z" }, "x-strapi-config": { "path": "/documentation",