fix(frontend): calendar thumbnail, episode delete confirm, mark-as-watched dialog

- CalendarPage: restore poster/still thumbnail (h-8 w-5) in episode items;
  add getTmdbPosterUrl import; extend EpisodeWithEntry type with poster_path
- EpisodeSeenEditDialog: add mode 'create'|'edit' support; record prop is now
  optional; create mode uses useCreateEpisodeSeen with today as default date
- EpisodePage: Mark as Watched button now opens EpisodeSeenEditDialog (create
  mode) instead of firing mutation directly; delete shows ConfirmDialog before
  deleting; remove unused useCreateEpisodeSeen import
This commit is contained in:
Mohammed Abad committed 2026-04-01 00:59:09 +01:00
1 parent 3ca24434d7
commit 191f4d6aae
8 files changed
+350 -101

No files matched your search

@@ -40,6 +40,28 @@ export function useCreateEpisodeSeen() {
});
}
export function useUpdateEpisodeSeen() {
const queryClient = useQueryClient();
return useMutation({
mutationFn: ({
id,
data,
}: {
id: number;
data: { episode_id: number; entry_id: number; date_seen?: string; seen_with?: string | null };
}) => episodeSeenApi.update(id, data),
onSuccess: (_data, variables) => {
queryClient.invalidateQueries({
queryKey: episodeSeenKeys.byEpisode(variables.data.episode_id),
});
queryClient.invalidateQueries({
queryKey: entryKeys.detail(variables.data.entry_id),
});
},
});
}
export function useDeleteEpisodeSeen() {
const queryClient = useQueryClient();