chore: refactor response error handling

This commit is contained in:
Ramires Viana committed 2022-05-04 12:11:36 +00:00
1 parent d1d7b23da6
commit 96afaca0ad
16 files changed
+61 -93

No files matched your search

+1 -5
View File
@@ -5,12 +5,8 @@ export function get() {
}
export async function update(settings) {
const res = await fetchURL(`/api/settings`, {
await fetchURL(`/api/settings`, {
method: "PUT",
body: JSON.stringify(settings),
});
if (res.status !== 200) {
throw new Error(res.status);
}
}