This commit is contained in:
Jurgis Sakalauskas
2025-10-13 18:10:52 +03:00
parent ff18d0daeb
commit 7bc38e9a6e
7 changed files with 253 additions and 76 deletions
+23 -1
View File
@@ -111,9 +111,31 @@ export const updateProject = async (
projectId: string,
payload: UpdateProjectPayload
): Promise<Project> => {
const body: Record<string, unknown> = {};
if (payload.name !== undefined) {
body.name = payload.name;
}
if (payload.description !== undefined) {
body.description = payload.description ?? null;
}
if (payload.status !== undefined) {
body.status = payload.status;
}
if (payload.attributes !== undefined) {
body.attributes = payload.attributes;
}
if (payload.priorityRules !== undefined) {
body.priorityRules = payload.priorityRules;
}
const response = await apiFetch<SingleProjectResponse>(`/projects/${projectId}`, {
method: 'PATCH',
body: payload
body
});
return response.data;