stuff
This commit is contained in:
@@ -87,6 +87,19 @@ export const playlistsApi = api.injectEndpoints({
|
||||
{ type: 'Playlist', id: playlistId },
|
||||
],
|
||||
}),
|
||||
reorderPlaylistTracks: build.mutation<
|
||||
void,
|
||||
{ playlistId: string; trackIds: string[] }
|
||||
>({
|
||||
query: ({ playlistId, trackIds }) => ({
|
||||
url: `/playlists/${playlistId}/tracks/reorder`,
|
||||
method: 'PUT',
|
||||
body: { track_ids: trackIds },
|
||||
}),
|
||||
invalidatesTags: (_r, _e, { playlistId }) => [
|
||||
{ type: 'Playlist', id: playlistId },
|
||||
],
|
||||
}),
|
||||
}),
|
||||
overrideExisting: false,
|
||||
});
|
||||
@@ -100,4 +113,5 @@ export const {
|
||||
useDeletePlaylistMutation,
|
||||
useAddTrackToPlaylistMutation,
|
||||
useRemoveTrackFromPlaylistMutation,
|
||||
useReorderPlaylistTracksMutation,
|
||||
} = playlistsApi;
|
||||
|
||||
Reference in New Issue
Block a user