pangea-server 1.0.51 → 1.0.52

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.
@@ -9,7 +9,7 @@ type IncludeItem = {
9
9
  active?: boolean;
10
10
  include?: IncludeItem[];
11
11
  };
12
- type Filters<BM extends BaseModel> = ModelId | Where<BM>;
12
+ type Filters<BM extends BaseModel> = ModelId | Where<BM> | undefined;
13
13
  type Group = string[];
14
14
  type Order = Record<string, 'asc' | 'desc'>;
15
15
  type FindOneOptions = {
@@ -26,7 +26,7 @@ class Db {
26
26
  }
27
27
  return scopedModel.findOne({
28
28
  ...baseOptions,
29
- ...getIncludeAndWhere(model, include, undefined, filters),
29
+ ...getIncludeAndWhere(model, include, { withoutAttributes: !!attributes }, filters),
30
30
  order: getFinalOrder(order),
31
31
  });
32
32
  }
@@ -60,10 +60,7 @@ class Db {
60
60
  async findManyWithCount(model, options = {}) {
61
61
  const { page, pageSize } = options;
62
62
  if (page && pageSize) {
63
- const [instances, totalCount] = await Promise.all([
64
- this.findMany(model, options),
65
- this.count(model, options),
66
- ]);
63
+ const [instances, totalCount] = await Promise.all([this.findMany(model, options), this.count(model, options)]);
67
64
  return { instances, totalCount };
68
65
  }
69
66
  const instances = await this.findMany(model, options);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pangea-server",
3
3
  "description": "",
4
- "version": "1.0.51",
4
+ "version": "1.0.52",
5
5
  "files": [
6
6
  "dist"
7
7
  ],