Separating users from tasks + fixing weird ota bug
This commit is contained in:
@@ -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 ─────────────────────────────────────────────────────────
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user