This commit is contained in:
@ -230,8 +230,19 @@ export function IdeasTable() {
|
||||
updateIdea.mutate(
|
||||
{ id, dto },
|
||||
{
|
||||
onSuccess: (updatedIdea) => {
|
||||
setDetailIdea(updatedIdea);
|
||||
onSuccess: () => {
|
||||
// Обновляем только те поля, которые были отправлены в dto
|
||||
// Это сохраняет specification и другие поля которые не редактировались
|
||||
setDetailIdea((prev) => {
|
||||
if (!prev) return prev;
|
||||
const updates: Partial<Idea> = {};
|
||||
(Object.keys(dto) as (keyof UpdateIdeaDto)[]).forEach((key) => {
|
||||
if (dto[key] !== undefined) {
|
||||
(updates as Record<string, unknown>)[key] = dto[key];
|
||||
}
|
||||
});
|
||||
return { ...prev, ...updates };
|
||||
});
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
4
frontend/test-results/.last-run.json
Normal file
4
frontend/test-results/.last-run.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"status": "failed",
|
||||
"failedTests": []
|
||||
}
|
||||
Reference in New Issue
Block a user