prevent type coercion

- remove unused imports
- minor refactors and cleanups
This commit is contained in:
geoffrey45
2022-02-16 15:06:29 +03:00
parent 9972caf7d3
commit 5446b1fe4b
26 changed files with 190 additions and 206 deletions
+4 -6
View File
@@ -10,13 +10,11 @@ const getAlbumTracks = async (name, artist) => {
);
if (!res.ok) {
const message = `An error has occured: ${res.status}`;
const message = `An error has occurred: ${res.status}`;
throw new Error(message);
}
const data = await res.json();
return data;
return await res.json();
};
const getAlbumArtists = async (name, artist) => {
@@ -30,7 +28,7 @@ const getAlbumArtists = async (name, artist) => {
);
if (!res.ok) {
const message = `An error has occured: ${res.status}`;
const message = `An error has occurred: ${res.status}`;
throw new Error(message);
}
@@ -49,7 +47,7 @@ const getAlbumBio = async (name, artist) => {
);
if (!res.ok) {
const message = `An error has occured: ${res.status}`;
const message = `An error has occurred: ${res.status}`;
throw new Error(message);
}