@nocobase/database 0.7.6-alpha.2 → 0.7.7-alpha.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.
@@ -105,7 +105,7 @@ class FormulaField extends _field.Field {
105
105
  result = math().round(result, 9);
106
106
  } catch (_unused) {}
107
107
 
108
- if (result) {
108
+ if (result === 0 || result) {
109
109
  instance.set(name, result);
110
110
  }
111
111
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/database",
3
- "version": "0.7.6-alpha.2",
3
+ "version": "0.7.7-alpha.1",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -12,7 +12,7 @@
12
12
  }
13
13
  ],
14
14
  "dependencies": {
15
- "@nocobase/utils": "0.7.6-alpha.2",
15
+ "@nocobase/utils": "0.7.7-alpha.1",
16
16
  "async-mutex": "^0.3.2",
17
17
  "cron-parser": "4.4.0",
18
18
  "deepmerge": "^4.2.2",
@@ -32,5 +32,5 @@
32
32
  "url": "git+https://github.com/nocobase/nocobase.git",
33
33
  "directory": "packages/database"
34
34
  },
35
- "gitHead": "2cfccff9d3ff14c521bf317fa7ee4efa18444c92"
35
+ "gitHead": "f82374e6f9daaf71ba63eaf156468ea7ddc042da"
36
36
  }
@@ -40,7 +40,7 @@ export class FormulaField extends Field {
40
40
  );
41
41
  }
42
42
  }
43
- }
43
+ };
44
44
 
45
45
  caculateField = async (instance) => {
46
46
  const { expression, name } = this.options;
@@ -50,10 +50,10 @@ export class FormulaField extends Field {
50
50
  result = math.evaluate(expression, scope);
51
51
  result = math.round(result, 9);
52
52
  } catch {}
53
- if (result) {
53
+ if (result === 0 || result) {
54
54
  instance.set(name, result);
55
55
  }
56
- }
56
+ };
57
57
 
58
58
  updateFieldData = async (instance, { transaction }) => {
59
59
  if (this.collection.name === instance.collectionName && instance.name === this.options.name) {
@@ -80,7 +80,7 @@ export class FormulaField extends Field {
80
80
  );
81
81
  }
82
82
  }
83
- }
83
+ };
84
84
 
85
85
  bind() {
86
86
  super.bind();