Skip to content

Commit

Permalink
Make spacing consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
skycube19 committed Nov 5, 2024
1 parent aa8b442 commit d80a7cf
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions src/services/reorderPlaylistService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,32 @@ export default async function reorderPlaylist(playlistID: string, sortedTrackURI
}

async function PlaylistAPICall(requestType: string, uri: string, chunk: string[]) {
const accessToken = Spicetify.Platform.Session.accessToken;

let trackURIs = [];
if (requestType == "DELETE") {
for (const songURI of chunk) {
trackURIs.push({
uri: songURI
});
}
}

let response = await fetch(uri, {
method: requestType,
headers: {
Authorization: `Bearer ${accessToken}`,
},
body: JSON.stringify(requestType == "POST" ? {
uris: chunk
} : {
tracks: trackURIs
}),
});

if (response.status == 200) {
console.log(requestType, ' playlist API call successful!');
} else {
console.error('Failed ', requestType, ' playlist API call: ', response.status, response.statusText);
}
const accessToken = Spicetify.Platform.Session.accessToken;

let trackURIs = [];
if (requestType == "DELETE") {
for (const songURI of chunk) {
trackURIs.push({
uri: songURI
});
}
}

let response = await fetch(uri, {
method: requestType,
headers: {
Authorization: `Bearer ${accessToken}`,
},
body: JSON.stringify(requestType == "POST" ? {
uris: chunk
} : {
tracks: trackURIs
}),
});

if (response.status == 200) {
console.log(requestType, ' playlist API call successful!');
} else {
console.error('Failed ', requestType, ' playlist API call: ', response.status, response.statusText);
}
}

0 comments on commit d80a7cf

Please sign in to comment.