Skip to content

Commit

Permalink
fix: /wallets/:id/trust_relationships returns 404 for invalid id
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavkparti committed Aug 19, 2023
1 parent 84ff548 commit 39ac44f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/services/TrustService.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ class TrustService {
offset = 0,
limit,
}) {
// check of wallet exists first
// throws error if no wallet matching walletId exists
const walletService = new WalletService()
await walletService.getWallet(walletId)

return this._trust.getTrustRelationships({
walletId,
state,
Expand Down Expand Up @@ -104,6 +109,11 @@ 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 39ac44f

Please sign in to comment.