Skip to content

Commit

Permalink
Merge pull request #988 from OneCommunityGlobal/xiaow_hotfix_of_timeE…
Browse files Browse the repository at this point in the history
…ntryController

XiaoW_Hotfix of timeEntryController
  • Loading branch information
one-community authored Jun 14, 2024
2 parents 3e1ddd3 + d2e4c65 commit 9ee17da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/controllers/timeEntryController.js
Original file line number Diff line number Diff line change
Expand Up @@ -921,9 +921,9 @@ const timeEntrycontroller = function (TimeEntry) {
record.userProfile = element.personId;
record.dateOfWork = element.dateOfWork;
[record.hours, record.minutes] = formatSeconds(element.totalSeconds);
record.projectId = element.projectId._id;
record.projectName = element.projectId.projectName;
record.projectCategory = element.projectId.category.toLowerCase();
record.projectId = element.projectId?._id || null;
record.projectName = element.projectId?.projectName || null;
record.projectCategory = element.projectId?.category.toLowerCase() || null;
record.taskId = element.taskId?._id || null;
record.taskName = element.taskId?.taskName || null;
record.taskClassification = element.taskId?.classification?.toLowerCase() || null;
Expand All @@ -934,6 +934,7 @@ const timeEntrycontroller = function (TimeEntry) {
res.status(200).send(data);
})
.catch((error) => {
logger.logException(error);
res.status(400).send(error);
});
};
Expand Down

0 comments on commit 9ee17da

Please sign in to comment.