saving project notes
This commit is contained in:
@@ -132,11 +132,15 @@ export async function createProject({ name, description, colour, icon, isolated
|
||||
return res.json();
|
||||
}
|
||||
|
||||
export async function updateProject(id, { name, description, colour, icon, isolated }) {
|
||||
export async function updateProject(id, fields = {}) {
|
||||
// Convert isolated boolean to integer if present
|
||||
const body = { ...fields };
|
||||
if (body.isolated !== undefined) body.isolated = body.isolated ? 1 : 0;
|
||||
|
||||
const res = await fetch(`${BASE_URL}/projects/${id}`, {
|
||||
method: 'PATCH',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ name, description, colour, icon, isolated: isolated ? 1 : 0}),
|
||||
body: JSON.stringify(body),
|
||||
});
|
||||
if (!res.ok) throw new Error(`Failed to update project: ${res.status}`);
|
||||
return res.json();
|
||||
|
||||
Reference in New Issue
Block a user