Skip to content

Commit

Permalink
Bugfix: catch Kimai data invalid actions/projects/customers
Browse files Browse the repository at this point in the history
  • Loading branch information
KatjaGlassConsulting committed Feb 25, 2022
1 parent a4bcaa5 commit 4ba33dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "timekex",
"version": "0.1.1",
"version": "0.1.2",
"private": true,
"homepage": ".",
"license": "MIT",
Expand Down
8 changes: 4 additions & 4 deletions src/components/WeekDataDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ export const WeekDataDisplay = ({ dispatch }) => {
var kimaiDisplayData = kimaiTimesheets.filter(item => item.begin.split('T')[0] >= startDay && item.end?.split('T')[0] <= endDay);

// loop through DB data and update Sheet link if available, otherwise include into display data
kimaiDisplayData.forEach(item => {
kimaiDisplayData.forEach(item => {
const entry = {
timesheetId: item.id,
date: item.begin.split('T')[0],
start: item.begin.substring(11, 16),
end: item.end.substring(11, 16),
project: kimaiData.projects[item.project].name,
projectId: item.project,
customer: kimaiData.projects[item.project].customer.name,
customerId: kimaiData.projects[item.project].customer.id,
activity: kimaiData.activities[item.activity].name,
customer: kimaiData.projects[item.project].customer.name || "ERROR - invalid customer",
customerId: kimaiData.projects[item.project]?.customer.id || "ERROR - invalid project",
activity: kimaiData.activities[item.activity]?.name || "ERROR - invalid activity",
activityId: item.activity,
description: item.description ? item.description : "",
billable: item.billable
Expand Down

0 comments on commit 4ba33dc

Please sign in to comment.