feat: cache marka api responses

This commit is contained in:
Max Richter
2025-11-04 12:09:17 +01:00
parent bb4e895770
commit fea9b69d4d
9 changed files with 163 additions and 98 deletions

View File

@@ -50,13 +50,17 @@ export const createNewSeries: MenuEntry = {
return {
title: `${r.name} - ${r.first_air_date}`,
cb: async () => {
state.activeState.value = "loading";
const response = await fetch("/api/series/" + r.id, {
method: "POST",
});
const series = await response.json() as ReviewResource;
unsub();
globalThis.location.href = "/series/" + series.name;
try {
state.activeState.value = "loading";
const response = await fetch("/api/series/" + r.id, {
method: "POST",
});
const series = await response.json() as ReviewResource;
unsub();
globalThis.location.href = "/series/" + series.name;
} catch (_e) {
state.activeState.value = "normal";
}
},
};
}),