Sync metadata store after view child entity mutations server response (#23150)

## Summary

- View persist hooks
(`usePerformView(Sort|Field|Filter|Group|FieldGroup|FilterGroup|)APIPersist`)
now write successful mutation results back to the metadata store
(`addToDraft` / `updateInDraft` / `removeFromDraft` + `applyChanges`),
following the existing pattern from `usePerformViewAPIUpdate`.
- Previously the store only updated via SSE, so until that landed, save
flows diffed against stale view data and re-sent creates with the same
id — failing server-side with a duplicate key error.

Fixes TWENTY-SERVER-HQM
This commit is contained in:
Paul Rastoin
2026-07-22 19:05:22 +02:00
committed by GitHub
parent f52643d170
commit 987995636f
14 changed files with 584 additions and 913 deletions
@@ -207,9 +207,16 @@ export const useCreateViewFromCurrentView = (viewBarComponentId?: string) => {
id: v4(),
}));
await performViewFilterGroupAPICreate(viewFilterGroupsToCreate, {
id: newViewId,
});
const filterGroupResult = await performViewFilterGroupAPICreate(
viewFilterGroupsToCreate,
{
id: newViewId,
},
);
if (filterGroupResult.status === 'failed') {
return undefined;
}
const createViewFilterInputs = viewFiltersToCreate.map(
(viewFilter) => ({