This commit is contained in:
Alexander Drozdov
2022-05-21 02:19:48 +03:00
parent 162bd9e80f
commit c83a63fcdb
@@ -545,11 +545,11 @@ export async function requestResults (
const response = await fetch(`${MainProcess.CORS}https://${getTradeEndpoint()}/api/trade/fetch/${resultIds.join(',')}?query=${queryId}`)
adjustRateLimits(RATE_LIMIT_RULES.FETCH, response.headers)
const _data = await response.json() as TradeResponse<{ result: FetchResult[] }>
const _data = await response.json() as TradeResponse<{ result: Array<FetchResult | null> }>
if (_data.error) {
throw new Error(_data.error.message)
} else {
data = _data.result
data = _data.result.filter(res => res != null) as FetchResult[]
}
cache.set<FetchResult[]>(resultIds, data, Cache.deriveTtl(...RATE_LIMIT_RULES.SEARCH, ...RATE_LIMIT_RULES.FETCH))