From 3d7a8c54ec24771f0c1bc0677d9751be4e4d0e7a Mon Sep 17 00:00:00 2001 From: Alexandra Dumitru Date: Mon, 4 Apr 2022 11:48:53 +0300 Subject: [PATCH] fix: editing a unit deletes the existing issuance on it --- src/controllers/units.controller.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/controllers/units.controller.js b/src/controllers/units.controller.js index 47150293..1516c63e 100644 --- a/src/controllers/units.controller.js +++ b/src/controllers/units.controller.js @@ -303,8 +303,7 @@ export const update = async (req, res) => { // if we are reusing a record, make sure it exists await assertRecordExistance(Issuance, updatedRecord.issuance.id); updatedRecord.issuanceId = updatedRecord.issuance.id; - - delete updatedRecord.issuance; + updatedRecord.issuance.orgUid = orgUid; } else { updatedRecord.issuance.id = uuidv4(); updatedRecord.issuance.orgUid = orgUid;