openchs-models 1.32.55 → 1.32.56

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.
package/dist/Concept.js CHANGED
@@ -85,11 +85,11 @@ class Concept extends _BaseEntity.default {
85
85
  }
86
86
 
87
87
  getImageMedia() {
88
- return this.media ? this.media.filter(m => m.isImage()) : [];
88
+ return this.media.filter(m => m.isImage());
89
89
  }
90
90
 
91
91
  getVideoMedia() {
92
- return this.media ? this.media.filter(m => m.isVideo()) : [];
92
+ return this.media.filter(m => m.isVideo());
93
93
  }
94
94
 
95
95
  hasImage() {
@@ -377,7 +377,7 @@ class Concept extends _BaseEntity.default {
377
377
  }
378
378
 
379
379
  hasMedia() {
380
- return this.media && this.media.length > 0 || this.hasAnswersWithMedia();
380
+ return this.media.length > 0 || this.hasAnswersWithMedia();
381
381
  }
382
382
 
383
383
  }
@@ -430,7 +430,8 @@ _defineProperty(Concept, "schema", {
430
430
  },
431
431
  media: {
432
432
  type: "list",
433
- objectType: "ConceptMedia"
433
+ objectType: "ConceptMedia",
434
+ default: []
434
435
  }
435
436
  }
436
437
  });
@@ -56,6 +56,7 @@ exports.default = ConceptMedia;
56
56
 
57
57
  _defineProperty(ConceptMedia, "schema", {
58
58
  name: "ConceptMedia",
59
+ embedded: true,
59
60
  primaryKey: "uuid",
60
61
  properties: {
61
62
  uuid: "string",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "openchs-models",
3
3
  "description": "OpenCHS data model to be used by front end clients",
4
- "version": "1.32.55",
4
+ "version": "1.32.56",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",