Skip to content

Commit

Permalink
fix: search by subscription needs to filter by tokenId
Browse files Browse the repository at this point in the history
  • Loading branch information
eruizgar91 committed Oct 19, 2023
1 parent 8b61061 commit 85d6d59
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/nevermined/api/SearchApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ export class SearchApi extends Instantiable {
*/
public async servicesByNftContract(
nftContractAddress: string,
tokenId: string,
customNestedQueries?: SearchQuery['query'][],
offset = 100,
page = 1,
Expand Down Expand Up @@ -522,6 +523,12 @@ export class SearchApi extends Instantiable {
nftContractAddress,
},
},
{
match: {
'service.attributes.serviceAgreementTemplate.conditions.parameters.value':
tokenId,
},
},
],
},
},
Expand Down Expand Up @@ -588,6 +595,7 @@ export class SearchApi extends Instantiable {

return this.servicesByNftContract(
nftContractAddress,
subscriptionDid,
customNestedQueries,
offset,
page,
Expand All @@ -610,6 +618,7 @@ export class SearchApi extends Instantiable {
*/
public async datasetsByNftContract(
nftContractAddress: string,
tokenId: string,
customNestedQueries?: SearchQuery['query'][],
offset = 100,
page = 1,
Expand Down Expand Up @@ -659,6 +668,12 @@ export class SearchApi extends Instantiable {
nftContractAddress,
},
},
{
match: {
'service.attributes.serviceAgreementTemplate.conditions.parameters.value':
tokenId,
},
},
],
},
},
Expand Down Expand Up @@ -725,6 +740,7 @@ export class SearchApi extends Instantiable {

return this.datasetsByNftContract(
nftContractAddress,
subscriptionDid,
customNestedQueries,
offset,
page,
Expand Down

0 comments on commit 85d6d59

Please sign in to comment.