1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-18 02:23:12 +02:00

OMG all the things are horrible

This commit is contained in:
Philipp Heckel 2022-12-07 21:26:18 -05:00
parent 8dcb4be8a8
commit c5b6971447
5 changed files with 119 additions and 52 deletions
web/src/app

View file

@ -172,6 +172,20 @@ class Api {
console.log(`[Api] Account`, account);
return account;
}
async updateUserAccount(baseUrl, token, payload) {
const url = userAccountUrl(baseUrl);
const body = JSON.stringify(payload);
console.log(`[Api] Updating user account ${url}: ${body}`);
const response = await fetch(url, {
method: "POST",
headers: maybeWithBearerAuth({}, token),
body: body
});
if (response.status !== 200) {
throw new Error(`Unexpected server response ${response.status}`);
}
}
}
const api = new Api();