Fix record table dashboard save (#20202)
## Summary Fixes `METADATA_VALIDATION_FAILED` / “view field already exists” when saving dashboard **record table** widgets after the first persist (e.g. several table widgets on one dashboard). ## Problem Draft view columns used **client-generated** `viewField` ids. After save, the API stored **different** ids. The next upsert still sent the old draft ids as `viewFieldId`. The server only matched on that id, missed every row, and tried to **create** columns that already existed for the same `fieldMetadataId` + view.
This commit is contained in:
@@ -65,7 +65,6 @@ export const useSaveRecordTableWidgetViews = () => {
|
||||
input: {
|
||||
widgetId: widget.id,
|
||||
viewFields: widgetViewDraft.viewFields.map((field) => ({
|
||||
...(isDefined(field.id) ? { viewFieldId: field.id } : {}),
|
||||
fieldMetadataId: field.fieldMetadataId,
|
||||
isVisible: field.isVisible,
|
||||
position: field.position,
|
||||
|
||||
Reference in New Issue
Block a user