adminizer 4.3.0-build.141 → 4.3.0-build.143

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.
@@ -65,7 +65,7 @@ export class ImageItem extends File {
65
65
  await this.createMeta(parent.id);
66
66
  await this.addFileMeta(file.path, parent.id);
67
67
  // create file variants
68
- if (Object.keys(this.imageSizes).length) {
68
+ if (Object.keys(this.imageSizes).length && file.mimetype !== 'image/svg+xml') {
69
69
  await this.createVariants(file, parent, filename, group);
70
70
  }
71
71
  // TODO refactor CRUD functions for DataAccessor usage
@@ -33,6 +33,12 @@ export class WaterlineModel extends AbstractModel {
33
33
  return await query;
34
34
  }
35
35
  async _find(criteria = {}, options = {}) {
36
+ // Hack
37
+ const attributes = this.model.attributes;
38
+ const associations = Object.keys(attributes).filter(attr => attributes[attr].model || attributes[attr].collection);
39
+ //@ts-ignore
40
+ if (associations.includes(criteria?.sort?.split(' ')[0]) && JSON.stringify(criteria.where) === '{}')
41
+ criteria.sort = undefined;
36
42
  let query = this.model.find(criteria);
37
43
  if (options.populate && Array.isArray(options.populate) && options.populate.length > 0) {
38
44
  options.populate.forEach(([field, populateCriteria]) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "adminizer",
3
3
  "type": "module",
4
- "version": "4.3.0-build.141",
4
+ "version": "4.3.0-build.143",
5
5
  "main": "index.js",
6
6
  "exports": {
7
7
  ".": "./index.js",