Skip to content

Commit

Permalink
Fix for test assets
Browse files Browse the repository at this point in the history
  • Loading branch information
ericnewcomer committed Nov 8, 2024
1 parent b1d0ef6 commit 547a849
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/external/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
Expand Down

0 comments on commit 547a849

Please sign in to comment.