|
const pendingFullState = _.merge({}, org.toObject(), pendingReviewData) |
However, org comes from:
|
const org = await repo.findOneByShortName(shortName) |
(i.e., what existed in the database whenever that line of code executed) but pendingReviewData comes from:
|
const pendingReview = await reviewRepo.getOrgReviewObjectByOrgShortname(shortName, isSecretariat, { session }) |
(i.e., reading from the transaction snapshot). By retrieving pendingReviewData and the stored BaseOrg document inside the same transaction, one can increase the likelihood that the review data was intended to be applicable to that BaseOrg document.
cve-services/src/controller/registry-org.controller/registry-org.controller.js
Line 300 in 1df06cb
However, org comes from:
cve-services/src/controller/registry-org.controller/registry-org.controller.js
Line 244 in 1df06cb
(i.e., what existed in the database whenever that line of code executed) but pendingReviewData comes from:
cve-services/src/controller/registry-org.controller/registry-org.controller.js
Line 294 in 1df06cb
(i.e., reading from the transaction snapshot). By retrieving pendingReviewData and the stored BaseOrg document inside the same transaction, one can increase the likelihood that the review data was intended to be applicable to that BaseOrg document.