refresh user playlists to update track counts

add docs to query keys
This commit is contained in:
Violet Caulfield
2025-03-22 11:09:35 -05:00
parent 4344ac6402
commit cd55ea05da
2 changed files with 21 additions and 0 deletions
@@ -67,6 +67,10 @@ export default function TrackOptions({
trigger("notificationSuccess");
queryClient.invalidateQueries({
queryKey: [QueryKeys.UserPlaylists]
});
queryClient.invalidateQueries({
queryKey: [QueryKeys.ItemTracks, playlist.Id!],
});
+17
View File
@@ -27,7 +27,24 @@ export enum QueryKeys {
ArtistImage = "ArtistImage",
PlaybackStateChange = "PlaybackStateChange",
Player = "Player",
/**
* Query representing the fetching of a user's created playlist.
*
* This differs from "Favorite Playlists", which are playlists
* that exist on the server not created by the user that the user
* has favorited
*
* Invalidation occurs by providing this query key
*/
UserPlaylists = "UserPlaylists",
/**
* Query representing the fetching of tracks for an album or playlist.
*
* Invalidation occurs when the ID of the album or playlist is provided
* as a query key
*/
ItemTracks = "ItemTracks",
RefreshHome = "RefreshHome",
FavoriteArtists = "FavoriteArtists",