mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-26 17:12:30 -04:00
Fix watchlist apis & add delete watchlist api
This commit is contained in:
@@ -70,19 +70,19 @@ export const ItemContext = ({
|
||||
const { t } = useTranslation();
|
||||
|
||||
const mutation = useMutation({
|
||||
path: [kind, slug, "watchStatus"],
|
||||
path: ["api", `${kind}s`, slug, "watchstatus"],
|
||||
compute: (newStatus: WatchStatusV | null) => ({
|
||||
method: newStatus ? "POST" : "DELETE",
|
||||
params: newStatus ? { status: newStatus } : undefined,
|
||||
body: newStatus ? { status: newStatus } : undefined,
|
||||
}),
|
||||
invalidate: [kind, slug],
|
||||
});
|
||||
|
||||
const metadataRefreshMutation = useMutation({
|
||||
method: "POST",
|
||||
path: [kind, slug, "refresh"],
|
||||
invalidate: null,
|
||||
});
|
||||
// const metadataRefreshMutation = useMutation({
|
||||
// method: "POST",
|
||||
// path: [kind, slug, "refresh"],
|
||||
// invalidate: null,
|
||||
// });
|
||||
|
||||
return (
|
||||
<Menu
|
||||
@@ -127,16 +127,16 @@ export const ItemContext = ({
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{account?.isAdmin === true && (
|
||||
<>
|
||||
<HR />
|
||||
<Menu.Item
|
||||
label={t("home.refreshMetadata")}
|
||||
icon={Refresh}
|
||||
onSelect={() => metadataRefreshMutation.mutate()}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{/* {account?.isAdmin === true && ( */}
|
||||
{/* <> */}
|
||||
{/* <HR /> */}
|
||||
{/* <Menu.Item */}
|
||||
{/* label={t("home.refreshMetadata")} */}
|
||||
{/* icon={Refresh} */}
|
||||
{/* onSelect={() => metadataRefreshMutation.mutate()} */}
|
||||
{/* /> */}
|
||||
{/* </> */}
|
||||
{/* )} */}
|
||||
</Menu>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -46,7 +46,7 @@ export const WatchListInfo = ({
|
||||
const { t } = useTranslation();
|
||||
|
||||
const mutation = useMutation({
|
||||
path: [kind, slug, "watchStatus"],
|
||||
path: ["api", `${kind}s`, slug, "watchstatus"],
|
||||
compute: (newStatus: WatchStatus | null) => ({
|
||||
method: newStatus ? "POST" : "DELETE",
|
||||
body: newStatus ? { status: newStatus } : undefined,
|
||||
|
||||
Reference in New Issue
Block a user