fix: season episode dialog, mark season watched, episode 404 handling
Seasons Page: - Episode watch button now opens EpisodeSeenEditDialog instead of directly marking as watched, allowing date/seen-with input - Added "Mark Season as Watched" button that sequentially marks all unwatched episodes in the season Episode Page: - Fixed UI not updating after deleting the last episode seen record; the backend returns 404 when no records exist for an episode, which caused the query to error instead of resolving to an empty array. The API layer now catches 404 and returns [] gracefully.
This commit is contained in:
1 parent
984e2c8b50
commit
6bff2055b4
12 files changed
+380
-90
No files matched your search
@@ -8,7 +8,13 @@ export const entrySeenApi = {
|
||||
api.get<EntrySeen>(`/entry-seen/${id}`).then((r) => r.data),
|
||||
|
||||
getByEntry: (entryId: number) =>
|
||||
api.get<EntrySeen[]>(`/entry-seen/by-entry/${entryId}`).then((r) => r.data),
|
||||
api
|
||||
.get<EntrySeen[]>(`/entry-seen/by-entry/${entryId}`)
|
||||
.then((r) => r.data)
|
||||
.catch((err) => {
|
||||
if (err?.response?.status === 404) return [] as EntrySeen[];
|
||||
throw err;
|
||||
}),
|
||||
|
||||
create: (data: { entry_id: number; date_seen: string; seen_with?: string }) =>
|
||||
api.post<EntrySeen>('/entry-seen', data).then((r) => r.data),
|
||||
|
||||
@@ -10,7 +10,11 @@ export const episodeSeenApi = {
|
||||
getByEpisode: (episodeId: number) =>
|
||||
api
|
||||
.get<EpisodeSeen[]>(`/episode-seen/by-episode/${episodeId}`)
|
||||
.then((r) => r.data),
|
||||
.then((r) => r.data)
|
||||
.catch((err) => {
|
||||
if (err?.response?.status === 404) return [] as EpisodeSeen[];
|
||||
throw err;
|
||||
}),
|
||||
|
||||
create: (data: {
|
||||
entry_id: number;
|
||||
|
||||
Reference in new issue
Block a user