@steedos/standard-object-database 2.4.9-beta.1 → 2.4.9-beta.3

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.
@@ -13,7 +13,6 @@ fields:
13
13
  type: text
14
14
  searchable: true
15
15
  index: true
16
- required: true
17
16
  inlineHelpText: Can only contain lowercase letters and numbers, must start with a letter, cannot end with an underscore character or contain two consecutive underscore characters
18
17
  object_name:
19
18
  label: Object
@@ -21,12 +21,19 @@ const getInternalListviews = async function(sourceListviews, filters, is_system)
21
21
 
22
22
  module.exports = {
23
23
  beforeInsert: async function () {
24
+ if (!this.doc.name) {
25
+ this.doc.name = 'listview_' + this.doc._id.toLowerCase();
26
+ }
24
27
  await util.checkAPIName(this.object_name, 'name', this.doc.name, undefined, [['is_system','!=', true], ['object_name','=', this.doc.object_name]]);
25
-
26
28
  },
27
29
  beforeUpdate: async function () {
28
30
  const oldDoc = await objectql.getObject(this.object_name).findOne(this.id)
29
31
  let name = oldDoc.name,object_name = oldDoc.object_name;
32
+
33
+ if (!this.doc.name) {
34
+ this.doc.name = 'listview_' + this.id.toLowerCase();
35
+ }
36
+
30
37
  if(_.has(this.doc, 'name')){
31
38
  name = this.doc.name
32
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/standard-object-database",
3
- "version": "2.4.9-beta.1",
3
+ "version": "2.4.9-beta.3",
4
4
  "main": "package.service.js",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -12,5 +12,5 @@
12
12
  "description": "steedos package",
13
13
  "repository": {},
14
14
  "license": "MIT",
15
- "gitHead": "c2fb22f5c8ac953ebfd9c30a9fd448f5191f58b8"
15
+ "gitHead": "f18764b587b85d8406c7773148b443d1511e239b"
16
16
  }