chore: fix typescript with optional return from api call
This commit is contained in:
@@ -19,7 +19,7 @@ export async function retrieveAllPlaylists() {
|
||||
const playlistParams = new URLSearchParams(playlistOptions).toString();
|
||||
|
||||
return fetchApi<{ Items: Playlist[] }>(({ user_id }) => `/Users/${user_id}/Items?${playlistParams}`)
|
||||
.then((d) => d.Items);
|
||||
.then((d) => d!.Items);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -34,5 +34,5 @@ export async function retrievePlaylistTracks(ItemId: string) {
|
||||
const singlePlaylistParams = new URLSearchParams(singlePlaylistOptions).toString();
|
||||
|
||||
return fetchApi<{ Items: AlbumTrack[] }>(`/Playlists/${ItemId}/Items?${singlePlaylistParams}`)
|
||||
.then((d) => d.Items);
|
||||
.then((d) => d!.Items);
|
||||
}
|
||||
Reference in New Issue
Block a user