Separating users from tasks + fixing weird ota bug

This commit is contained in:
2026-03-07 23:41:26 -05:00
parent 3fa879d007
commit ac95358561
14 changed files with 657 additions and 308 deletions
+19
View File
@@ -163,6 +163,25 @@ export async function removeUser(id) {
return res.json();
}
/**
* Update a user's name.
* @param {number} id
* @param {string} name
* @returns {Promise<{status: string}>}
*/
export async function updateUser(id, name) {
const res = await fetch(`${API_BASE}/api/users/update`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ id, name })
});
if (!res.ok) {
const errorText = await res.text();
throw new Error(`Failed (${res.status}): ${errorText || res.statusText}`);
}
return res.json();
}
// ─── Task Management ─────────────────────────────────────────────────────────
/**