strapi-utils
Advanced tools
Comparing version 3.4.1 to 3.4.2
@@ -149,5 +149,13 @@ 'use strict'; | ||
normalizedClauses.forEach(({ field }) => { | ||
if (field.includes('.')) { | ||
const fieldDepth = field.split('.').length - 1; | ||
if (fieldDepth === 1) { | ||
// Check if the relational field exists | ||
getAssociationFromFieldKey({ model, field }); | ||
} else if (fieldDepth > 1) { | ||
const err = new Error( | ||
`Sorting on ${field} is not possible: you cannot sort at a depth greater than 1` | ||
); | ||
err.status = 400; | ||
throw err; | ||
} | ||
@@ -154,0 +162,0 @@ }); |
@@ -95,3 +95,3 @@ 'use strict'; | ||
const isPrivateAttribute = (model = {}, attributeName) => { | ||
return model.privateAttributes.includes(attributeName); | ||
return model && model.privateAttributes && model.privateAttributes.includes(attributeName); | ||
}; | ||
@@ -98,0 +98,0 @@ |
{ | ||
"name": "strapi-utils", | ||
"version": "3.4.1", | ||
"version": "3.4.2", | ||
"description": "Shared utilities for the Strapi packages", | ||
@@ -19,3 +19,3 @@ "homepage": "http://strapi.io", | ||
"date-fns": "^2.8.1", | ||
"lodash": "4.17.19", | ||
"lodash": "4.17.20", | ||
"pino": "^4.7.1", | ||
@@ -49,3 +49,3 @@ "pluralize": "^8.0.0", | ||
"license": "SEE LICENSE IN LICENSE", | ||
"gitHead": "8b9c3f2052ba449c653a9c4b90bdf09f98cf477d" | ||
"gitHead": "7505de6ad9736f89002e4642ceb506e5669ec179" | ||
} |
106141
3132
+ Addedlodash@4.17.20(transitive)
- Removedlodash@4.17.19(transitive)
Updatedlodash@4.17.20