From 547a849fdf242243625b4225ca8d71a4b1e03915 Mon Sep 17 00:00:00 2001 From: Eric Newcomer Date: Fri, 8 Nov 2024 21:07:33 +0000 Subject: [PATCH] Fix for test assets --- src/external/index.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/external/index.ts b/src/external/index.ts index ceccbe89c..396c37ec9 100644 --- a/src/external/index.ts +++ b/src/external/index.ts @@ -150,17 +150,18 @@ export const getAssetPage = (url: string, type: AssetType, id: string): Promise< .get(url) .then((response: AxiosResponse) => { if ( - response.headers['content-type'] === 'application/json' && - response.status >= 200 && - response.status < 300 + // test assets don't have headers or status + (!response.headers && !response.status) || + (response.headers['content-type'] === 'application/json' && + response.status >= 200 && + response.status < 300) ) { const assets: Asset[] = response.data.results.map((result: any, idx: number) => { const asset = resultToAsset(result, type, id); asset.order = idx; return asset; }); - resolve({ assets, next: response.data.next }); - return; + return resolve({ assets, next: response.data.next }); } reject(response); })