Skip to content

Commit

Permalink
fix: editing a unit deletes the existing issuance on it
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandradumitru22 committed Apr 4, 2022
1 parent e60a709 commit 3d7a8c5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/controllers/units.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3d7a8c5

Please sign in to comment.