Skip to content

Commit d75327d

Browse files
committed
deleting the review object after it is written to the org
1 parent 83c79be commit d75327d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/repositories/reviewObjectRepository.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,12 @@ class ReviewObjectRepository extends BaseRepository {
138138
}
139139
await baseOrgRepository.updateOrgFull(org.short_name, dataToUpdate, options, false, requestingUserUUID, false, true)
140140

141-
reviewObject.status = 'approved'
141+
// Delete the review object after approval
142+
await this.deleteReviewObjectByUUID(UUID, options)
142143

143-
await reviewObject.save({ options })
144-
const result = reviewObject.toObject()
145-
return result
144+
// Return the updated organization
145+
const updatedOrg = await baseOrgRepository.findOneByUUID(reviewObject.target_object_uuid)
146+
return updatedOrg ? updatedOrg.toObject() : null
146147
}
147148
}
148149

test/integration-tests/registry-org/registryOrgWithJointReviewTest.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ describe('Testing Joint approval', () => {
155155
.send(newBody)
156156
.then((res) => {
157157
expect(res).to.have.status(200)
158-
expect(res.body.status).to.equal('approved')
159158
})
160159
// Verify that the org was updated with the new body values
161160
await chai.request(app)
@@ -311,7 +310,6 @@ describe('Testing Joint approval', () => {
311310
.set(secretariatHeaders)
312311
.then((res) => {
313312
expect(res).to.have.status(200)
314-
expect(res.body.status).to.equal('approved')
315313
})
316314
})
317315
it('Check to see if the org was fully updated', async () => {

0 commit comments

Comments
 (0)