From 209dd379dcc92c607cf4fe25e9fb012bfb380a21 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 26 Jul 2021 16:59:17 +0200 Subject: [PATCH] switch over to app config metadataCacheUri --- app.config.js | 3 +-- src/utils/aquarius.ts | 11 ++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app.config.js b/app.config.js index b298d2412..d38ed464b 100644 --- a/app.config.js +++ b/app.config.js @@ -1,7 +1,6 @@ module.exports = { metadataCacheUri: - process.env.METADATACACHE_URI || - 'https://aquarius.mainnet.oceanprotocol.com', + process.env.METADATACACHE_URI || 'https://aquarius.oceanprotocol.com', // List of chainIds which metadata cache queries will return by default. // This preselects the Chains user preferences. diff --git a/src/utils/aquarius.ts b/src/utils/aquarius.ts index 4b31116e3..10adee35c 100644 --- a/src/utils/aquarius.ts +++ b/src/utils/aquarius.ts @@ -12,6 +12,7 @@ import { import { AssetSelectionAsset } from '../components/molecules/FormFields/AssetSelection' import { PriceList, getAssetsPriceList } from './subgraph' import axios, { CancelToken, AxiosResponse } from 'axios' +import { metadataCacheUri } from '../../app.config' function getQueryForAlgorithmDatasets(algorithmDid: string, chainId?: number) { return { @@ -49,7 +50,7 @@ export function transformQueryResult( } } -export function transformChainIdsListToQuery(chainIds: number[]) { +export function transformChainIdsListToQuery(chainIds: number[]): string { let chainQuery = '' chainIds.forEach((chainId) => { chainQuery += `chainId:${chainId} OR ` @@ -61,10 +62,10 @@ export function transformChainIdsListToQuery(chainIds: number[]) { export async function queryMetadata( query: SearchQuery, cancelToken: CancelToken -): Promise { +): Promise { try { const response: AxiosResponse = await axios.post( - `https://multiaqua.oceanprotocol.com/api/v1/aquarius/assets/ddo/query`, + `${metadataCacheUri}/api/v1/aquarius/assets/ddo/query`, { ...query, cancelToken } ) if (!response || response.status !== 200 || !response.data) return @@ -84,7 +85,7 @@ export async function retrieveDDO( ): Promise { try { const response: AxiosResponse = await axios.get( - `https://multiaqua.oceanprotocol.com/api/v1/aquarius/assets/ddo/${did}`, + `${metadataCacheUri}/api/v1/aquarius/assets/ddo/${did}`, { cancelToken } ) if (!response || response.status !== 200 || !response.data) return @@ -106,7 +107,7 @@ export async function getAssetsNames( ): Promise> { try { const response: AxiosResponse> = await axios.post( - `https://multiaqua.oceanprotocol.com/api/v1/aquarius/assets/names`, + `${metadataCacheUri}/api/v1/aquarius/assets/names`, { didList, cancelToken