@strapi/utils 4.20.0 → 4.20.2

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.
package/dist/index.mjs CHANGED
@@ -2086,7 +2086,9 @@ const createContentAPISanitizers = () => {
2086
2086
  }
2087
2087
  const nonWritableAttributes = getNonWritableAttributes(schema);
2088
2088
  const transforms = [
2089
- // Remove non writable attributes
2089
+ // Remove first level ID in inputs
2090
+ omit("id"),
2091
+ // Remove non-writable attributes
2090
2092
  traverseEntity$1(removeRestrictedFields(nonWritableAttributes), { schema })
2091
2093
  ];
2092
2094
  if (auth) {
@@ -2434,7 +2436,12 @@ const createContentAPIValidators = () => {
2434
2436
  }
2435
2437
  const nonWritableAttributes = getNonWritableAttributes(schema);
2436
2438
  const transforms = [
2437
- // non writable attributes
2439
+ (data2) => {
2440
+ if (isObject(data2) && "id" in data2) {
2441
+ throwInvalidParam({ key: "id" });
2442
+ }
2443
+ },
2444
+ // non-writable attributes
2438
2445
  traverseEntity$1(throwRestrictedFields(nonWritableAttributes), { schema })
2439
2446
  ];
2440
2447
  if (auth) {