feat: support removing watch status when null
A user can choose to remove a show from being in their media list completely, by setting the watch status to null
This commit is contained in:
@@ -16,7 +16,7 @@ const app = new OpenAPIHono<Env>();
|
||||
|
||||
const UpdateWatchStatusRequest = z.object({
|
||||
deviceId: z.string(),
|
||||
watchStatus: WatchStatus,
|
||||
watchStatus: WatchStatus.nullable(),
|
||||
titleId: AniListIdSchema,
|
||||
isRetrying: z.boolean().optional().default(false),
|
||||
});
|
||||
@@ -60,8 +60,12 @@ const route = createRoute({
|
||||
});
|
||||
|
||||
app.openapi(route, async (c) => {
|
||||
const { deviceId, watchStatus, titleId, isRetrying } =
|
||||
await c.req.json<typeof UpdateWatchStatusRequest._type>();
|
||||
const {
|
||||
deviceId,
|
||||
watchStatus,
|
||||
titleId,
|
||||
isRetrying = false,
|
||||
} = await c.req.json<typeof UpdateWatchStatusRequest._type>();
|
||||
const aniListToken = c.req.header("X-AniList-Token");
|
||||
|
||||
if (!isRetrying) {
|
||||
|
||||
Reference in New Issue
Block a user