memory settings implementation

This commit is contained in:
Storme-bit
2026-04-17 23:18:48 -07:00
parent 77275cf476
commit afae2af85b
3 changed files with 116 additions and 45 deletions
@@ -172,4 +172,20 @@ export async function getEpisodes({ limit = API_DEFAULTS.EPISODE_LIMIT, offset =
export async function deleteEpisode(id) {
const res = await fetch(`${BASE_URL}/episodes/${id}`, { method: 'DELETE' });
if (!res.ok) throw new Error(`Failed to delete episode: ${res.status}`);
}
export async function getSettings() {
const res = await fetch(`${BASE_URL}/settings`);
if (!res.ok) throw new Error(`Failed to fetch settings: ${res.status}`);
return res.json();
}
export async function updateSettings(updates) {
const res = await fetch(`${BASE_URL}/settings`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(updates),
});
if (!res.ok) throw new Error(`Failed to update settings: ${res.status}`);
return res.json();
}