memory settings implementation
This commit is contained in:
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user