Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

fix: matched searchCredsForProofReq method types to node wrapper #56

Merged
merged 2 commits into from
Jun 13, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,11 +593,12 @@ const indy = {
return JSON.parse(await IndySdk.proverGetCredentialsForProofReq(wh, JSON.stringify(proofRequest)))
},

async proverSearchCredentialsForProofReq(wh: WalletHandle, proofRequest: ProofRequest, extraQuery: {}) {
async proverSearchCredentialsForProofReq(wh: WalletHandle, proofRequest: ProofRequest, extraQuery: {} | null) {
//The NodeJS IndySDK wrapper differs from the Java and iOS wrappers in this call--it allows extraQuery to be a wql query object or null.
return await IndySdk.proverSearchCredentialsForProofReq(
wh,
JSON.stringify(proofRequest),
JSON.stringify(extraQuery)
JSON.stringify(extraQuery ? extraQuery : {})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
JSON.stringify(extraQuery ? extraQuery : {})
JSON.stringify(extraQuery || {})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe even JSON.stringify(extraQuery ?? {}) but I'm not sure if it'll be transpiled correctly with the current target 🤔

Copy link
Contributor

@TimoGlastra TimoGlastra Jun 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That won't work if you pass null

Edit: it will. My bad

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice suggestions here! I updated to @jakubkoci's suggestion, tested in RN and pushed.

)
},

Expand Down