1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00
This commit is contained in:
Ahmed Ali 2020-07-03 14:03:49 +02:00
parent 2756f5a019
commit a57d6610e2
2 changed files with 10 additions and 4 deletions

View File

@ -316,17 +316,17 @@ export class MetadataStore {
} }
public async getOwnerAssets(owner: string): Promise<DDO[]> { public async getOwnerAssets(owner: string): Promise<DDO[]> {
const query = { let q = {
offset: 100, offset: 100,
page: 1, page: 1,
query: { query: {
'publickey.id.owner': owner 'publicKey.owner': [owner]
}, },
sort: { sort: {
value: 1 value: 1
} }
} } as SearchQuery
return (await this.queryMetadata(query)).results return (await this.queryMetadata(q)).results
} }
/** /**

View File

@ -181,5 +181,11 @@ describe('Marketplace flow', () => {
) )
}) })
}) })
it ('owner can list there assets', async () => {
const assets = await ocean.assets.ownerAssets(
alice.getId()
)
assert(assets.length > 0)
})
}) })
}) })