@open-mercato/ui 0.6.6-develop.6205.1.109e4b6a84 → 0.6.6-develop.6228.1.cf483c68b5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2041,6 +2041,12 @@ function CrudForm({
2041
2041
  for (const injectedId of injectedFieldIdSet) {
2042
2042
  delete coreValues[injectedId];
2043
2043
  }
2044
+ if (customEntity) {
2045
+ const allowedKeys = new Set(cfDefinitions.map((definition) => definition.key).filter(Boolean));
2046
+ for (const key of Object.keys(coreValues)) {
2047
+ if (!allowedKeys.has(key)) delete coreValues[key];
2048
+ }
2049
+ }
2044
2050
  let parsedValues;
2045
2051
  if (schema) {
2046
2052
  const res = schema.safeParse(collapseDotPathFields(coreValues, dotPathBaseFieldIds));
@@ -2073,6 +2079,12 @@ function CrudForm({
2073
2079
  for (const injectedId of injectedFieldIdSet) {
2074
2080
  delete projectedCoreValues[injectedId];
2075
2081
  }
2082
+ if (customEntity) {
2083
+ const allowedKeys = new Set(cfDefinitions.map((definition) => definition.key).filter(Boolean));
2084
+ for (const key of Object.keys(projectedCoreValues)) {
2085
+ if (!allowedKeys.has(key)) delete projectedCoreValues[key];
2086
+ }
2087
+ }
2076
2088
  coreSubmitValues = schema ? schema.parse(collapseDotPathFields(projectedCoreValues, dotPathBaseFieldIds)) : projectedCoreValues;
2077
2089
  if (result.applyToForm) {
2078
2090
  setValues(result.data);