mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-11 00:10:24 +01:00
fixes the api call so it actually updates remotely
This commit is contained in:
@@ -96,13 +96,15 @@ export const useWatchlist = (item: BaseItemDto) => {
|
||||
}
|
||||
|
||||
// Watchlist == Jellyfin "Likes" rating:
|
||||
// POST /Users/{userId}/Items/{itemId}/Rating?likes=true - add to watchlist
|
||||
// DELETE /Users/{userId}/Items/{itemId}/Rating - remove from watchlist
|
||||
const path = `/Users/${currentUser.Id}/Items/${currentItem.Id}/Rating`;
|
||||
// POST /UserItems/{itemId}/Rating?userId={userId}&likes=true - add to watchlist
|
||||
// POST /UserItems/{itemId}/Rating?userId={userId}&likes=false - remove from watchlist
|
||||
const path = `/UserItems/${currentItem.Id}/Rating`;
|
||||
|
||||
const response = nextIsWatchlisted
|
||||
? await currentApi.post(path, {}, { params: { likes: true } })
|
||||
: await currentApi.delete(path, {});
|
||||
const response = await currentApi.post(
|
||||
path,
|
||||
{},
|
||||
{ params: { userId: currentUser.Id, likes: nextIsWatchlisted } },
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
onMutate: async (nextIsWatchlisted: boolean) => {
|
||||
|
||||
Reference in New Issue
Block a user