Add debug logs for API calls.
This commit is contained in:
parent
9f0f5a46b7
commit
2a4f6f2c48
|
@ -1,3 +1,4 @@
|
||||||
|
import {debug} from './debug.js';
|
||||||
import RelationLink from './relation-link.js';
|
import RelationLink from './relation-link.js';
|
||||||
|
|
||||||
type ApiReleaseData = {
|
type ApiReleaseData = {
|
||||||
|
@ -43,6 +44,7 @@ export default class Release {
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = (await apiResponse.json()) as ApiReleaseData;
|
const data = (await apiResponse.json()) as ApiReleaseData;
|
||||||
|
debug(data);
|
||||||
|
|
||||||
const artist = data['artist-credit']
|
const artist = data['artist-credit']
|
||||||
.map(({name, joinphrase}) => `${name}${joinphrase}`)
|
.map(({name, joinphrase}) => `${name}${joinphrase}`)
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import {debug} from './debug.js';
|
||||||
|
|
||||||
type ApiSearchData = {
|
type ApiSearchData = {
|
||||||
releases: Array<{
|
releases: Array<{
|
||||||
'artist-credit': Array<{
|
'artist-credit': Array<{
|
||||||
|
@ -41,6 +43,8 @@ export default async function searchReleases(
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = (await response.json()) as ApiSearchData;
|
const data = (await response.json()) as ApiSearchData;
|
||||||
|
debug(data);
|
||||||
|
|
||||||
const results: SearchResult[] = [];
|
const results: SearchResult[] = [];
|
||||||
|
|
||||||
for (const release of data.releases) {
|
for (const release of data.releases) {
|
||||||
|
|
Loading…
Reference in New Issue