Skip to content

Commit

Permalink
Merge pull request #1115 from OneCommunityGlobal/huijie-fix-add-lost-…
Browse files Browse the repository at this point in the history
…hours-editing-deleting

Huijie fix add lost hours editing deleting
  • Loading branch information
one-community authored Nov 27, 2024
2 parents e761275 + 9bd935b commit a09f0d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/controllers/timeEntryController.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ const timeEntrycontroller = function (TimeEntry) {

await timeEntry.save({ session });
if (userprofile) {
await userprofile.save({ session });
await userprofile.save({ session, validateModifiedOnly: true });
// since userprofile is updated, need to remove the cache so that the updated userprofile is fetched next time
removeOutdatedUserprofileCache(userprofile._id.toString());
}
Expand Down Expand Up @@ -867,7 +867,7 @@ const timeEntrycontroller = function (TimeEntry) {
}
await timeEntry.save({ session });
if (userprofile) {
await userprofile.save({ session });
await userprofile.save({ session, validateModifiedOnly: true });

// since userprofile is updated, need to remove the cache so that the updated userprofile is fetched next time
removeOutdatedUserprofileCache(userprofile._id.toString());
Expand Down Expand Up @@ -940,7 +940,7 @@ const timeEntrycontroller = function (TimeEntry) {

await timeEntry.remove({ session });
if (userprofile) {
await userprofile.save({ session });
await userprofile.save({ session, validateModifiedOnly: true });

// since userprofile is updated, need to remove the cache so that the updated userprofile is fetched next time
removeOutdatedUserprofileCache(userprofile._id.toString());
Expand Down

0 comments on commit a09f0d8

Please sign in to comment.