diff --git a/client/src/routes/Search.tsx b/client/src/routes/Search.tsx index d882c14..b49d90c 100644 --- a/client/src/routes/Search.tsx +++ b/client/src/routes/Search.tsx @@ -13,14 +13,14 @@ interface SearchProps { } interface SearchState { - assets: any[] + results: any[] isLoading: boolean page: number } export default class Search extends PureComponent { public state = { - assets: [], + results: [], isLoading: true, page: 0 } @@ -45,19 +45,19 @@ export default class Search extends PureComponent { } } - const assets = await this.context.ocean.aquarius.queryMetadata( + const search = await this.context.ocean.aquarius.queryMetadata( searchQuery ) - this.setState({ assets, isLoading: false }) - Logger.log(`Loaded ${assets.length} assets`) + this.setState({ results: search.results, isLoading: false }) + Logger.log(`Loaded ${this.state.results.length} assets`) } public renderResults = () => this.state.isLoading ? ( - ) : this.state.assets.length ? ( + ) : this.state.results && this.state.results.length ? (
- {this.state.assets.map((asset: any) => ( + {this.state.results.map((asset: any) => ( ))}