feat: cache marka api responses
This commit is contained in:
@@ -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";
|
||||
}
|
||||
},
|
||||
};
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user