mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
prevent type coercion
- remove unused imports - minor refactors and cleanups
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user