@strapi/utils 4.8.2 → 4.9.0-beta.1
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.
|
@@ -59,6 +59,12 @@ const defaultSanitizeSort = curry((schema, sort) => {
|
|
|
59
59
|
// Remove non attribute keys
|
|
60
60
|
traverseQuerySort(
|
|
61
61
|
({ key, attribute }, { remove }) => {
|
|
62
|
+
// ID is not an attribute per se, so we need to make
|
|
63
|
+
// an extra check to ensure we're not removing it
|
|
64
|
+
if (key === 'id') {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
62
68
|
if (!attribute) {
|
|
63
69
|
remove(key);
|
|
64
70
|
}
|
package/lib/traverse/factory.js
CHANGED
|
@@ -39,7 +39,8 @@ module.exports = () => {
|
|
|
39
39
|
for (const key of keys) {
|
|
40
40
|
const attribute =
|
|
41
41
|
schema?.attributes?.[key] ??
|
|
42
|
-
//
|
|
42
|
+
// FIX: Needed to not break existing behavior on the API.
|
|
43
|
+
// It looks for the attribute in the DB metadata when the key is in snake_case
|
|
43
44
|
schema?.attributes?.[strapi.db.metadata.get(schema?.uid).columnToAttribute[key]];
|
|
44
45
|
|
|
45
46
|
const newPath = { ...path };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/utils",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.0-beta.1",
|
|
4
4
|
"description": "Shared utilities for the Strapi packages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"node": ">=14.19.1 <=18.x.x",
|
|
47
47
|
"npm": ">=6.0.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "ff37d666d0634fc84827e3d6419d916618275572"
|
|
50
50
|
}
|