diff --git a/src/api/timesheet/services/timesheet.js b/src/api/timesheet/services/timesheet.js index 945ba10..8774d83 100644 --- a/src/api/timesheet/services/timesheet.js +++ b/src/api/timesheet/services/timesheet.js @@ -14,6 +14,7 @@ const clockifyConfig = { headers: { "X-Api-Key": process.env.CLOCKIFY_KEY, }, + id: 'clockify', cache: { // one hour maxAge: 60 * 60 * 1000 @@ -25,6 +26,7 @@ const leaveConfig = { headers: { Authorization: `Bearer ${process.env.LEAVE_API_TOKEN}` }, + id: 'leave', cache: { // one hour maxAge: 60 * 60 * 1000 @@ -89,7 +91,15 @@ module.exports = { const year = query ? Number(query.filters.year.$eq) : null, userIDs = query.filters.userIDs ? query.filters.userIDs.$in : null, - projectIDs = query.filters.projectIDs ? query.filters.projectIDs.$in : null + projectIDs = query.filters.projectIDs ? query.filters.projectIDs.$in : null, + clearCache = query.clearCache && query.clearCache === 'true' ? true : false + + console.log('clearCache:', clearCache) + + if (clearCache) { + await axios.storage.remove('clockify') + await axios.storage.remove('leave') + } const response = await fetchDetailedReport(year, userIDs, projectIDs) 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 b1f84c8..a0c3587 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-29T19:41:29.757Z" + "x-generation-date": "2024-08-29T19:49:13.196Z" }, "x-strapi-config": { "path": "/documentation",