Skip to content

Commit

Permalink
feat: delete /trust_relationship/:id
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavkparti committed Aug 22, 2023
1 parent 8dd6d22 commit 6718a17
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 8 additions & 0 deletions server/models/Trust.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,14 @@ class Trust {
'wallet_trust.id': trustRelationshipId,
});
const [trustRelationship] = trustRelationships;

if(!trustRelationship){
throw new HttpError(
404,
'No such trust relationship exists or it is not associated with the current wallet.'
)
}

if (trustRelationship?.originator_wallet_id !== walletId) {
throw new HttpError(
403,
Expand Down
5 changes: 0 additions & 5 deletions server/services/TrustService.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@ class TrustService {
}

async cancelTrustRequest({ walletLoginId, trustRelationshipId }) {
// check if trust relationship matching trustRelationshipId exists
// const trs = await this._session.getDB().select('*').from('wallet_trust').where('id', trustRelationshipId)
// console.log('TRUSTS', trs)


return this._trust.cancelTrustRequest({
walletId: walletLoginId,
trustRelationshipId,
Expand Down

0 comments on commit 6718a17

Please sign in to comment.