diff --git a/pages/playlists/[playlistId].vue b/pages/playlists/[playlistId].vue
index 709d334..797d865 100644
--- a/pages/playlists/[playlistId].vue
+++ b/pages/playlists/[playlistId].vue
@@ -20,16 +20,18 @@ const tabItems = [
{
label: 'Show statistics',
icon: 'pi pi-chart-bar',
- to: `./statistics`
+ to: `./stats`
}
];
-const { error, data } = await useFetch(
+const { error, data: playlist } = await useFetch<
+ Playlist & { notFound?: true }
+>(
() =>
- `https://raw.githubusercontent.com/mackorone/spotify-playlist-archive/master/playlists/pretty/${playlistId}.json`,
+ `https://raw.githubusercontent.com/mackorone/spotify-playlist-archive/main/playlists/pretty/${playlistId}.json`,
{
parseResponse: (body) =>
- body.includes('404') ? { notFound: true } : JSON.parse(body),
+ body === '404: Not Found' ? { notFound: true } : JSON.parse(body),
key: `playlist-${playlistId}`
}
);
@@ -47,20 +49,20 @@ const isNotFoundError = computed(
Something went wrong while fetching playlist's data
-
+
-
- {{ data.unique_name }}
-
- ({{ data.original_name }})
+
+ {{ playlist.unique_name }}
+
+ ({{ playlist.original_name }})
by
-
- {{ data.owner.name }}
+
+ {{ playlist.owner?.name }}
-
+