wip: Rework home's watchlist

This commit is contained in:
Zoe Roux
2025-12-21 16:58:14 +01:00
parent 556b9031a4
commit 04fef7bd20
5 changed files with 46 additions and 47 deletions
@@ -4,7 +4,7 @@ import BookmarkRemove from "@material-symbols/svg-400/rounded/bookmark_remove.sv
import Bookmark from "@material-symbols/svg-400/rounded/bookmark-fill.svg";
import type { ComponentProps } from "react";
import { useTranslation } from "react-i18next";
import type { Serie } from "~/models";
import type { Movie, Serie } from "~/models";
import { IconButton, Menu, tooltip } from "~/primitives";
import { useAccount } from "~/providers/account-context";
import { useMutation } from "~/query";
@@ -49,9 +49,10 @@ export const WatchListInfo = ({
path: [kind, slug, "watchStatus"],
compute: (newStatus: WatchStatus | null) => ({
method: newStatus ? "POST" : "DELETE",
params: newStatus ? { status: newStatus } : undefined,
body: newStatus ? { status: newStatus } : undefined,
}),
invalidate: [kind, slug],
invalidate: ["api", `${kind}s`, slug],
// optimistic is a pain to do because shows queries often have query params
});
if (mutation.isPending) status = mutation.variables;