Skip to content

Commit

Permalink
remove id and href if they are included on patch (#311)
Browse files Browse the repository at this point in the history
* remove id and href if they are included on patch
  • Loading branch information
wistefan authored Dec 19, 2024
1 parent 7d8919e commit 1fa15a8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions controllers/tmf-apis/party.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ const party = (function() {
});
}

if(typeof req.body != "undefined" ) {
// remove id and href from patches, since they would be rejected by tmf
let newBody = JSON.parse(req.body);
delete newBody.id
delete newBody.href
utils.updateBody(req, newBody)
}

const individualsPattern = new RegExp(
'^/' + config.endpoints.party.path + '/(individual|organization)(/([^/]*))?$'
);
Expand Down

0 comments on commit 1fa15a8

Please sign in to comment.