openchs-models 1.27.19 → 1.27.21

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.
@@ -454,7 +454,9 @@ class ObservationsHolder {
454
454
 
455
455
  static convertObsForSave(observations) {
456
456
  observations.forEach(observation => {
457
- observation.valueJSON = JSON.stringify(observation.valueJSON);
457
+ if (observation.valueJSON && typeof observation.valueJSON !== "string") {
458
+ observation.valueJSON = JSON.stringify(observation.valueJSON);
459
+ }
458
460
  });
459
461
  }
460
462
 
@@ -127,8 +127,8 @@ class Form extends _BaseEntity.default {
127
127
  _lodash.default.forEach(formMappings, ({
128
128
  subjectType
129
129
  }) => {
130
- const outOfSyncDrafts = entityService.findAll("DraftSubject").filtered(`subjectType = $0`, subjectType);
131
- entityService.clearDataIn(outOfSyncDrafts);
130
+ const outOfSyncDrafts = entityService.findAll("DraftSubject").filtered(`subjectType.uuid = $0`, subjectType.uuid);
131
+ entityService.deleteEntities(outOfSyncDrafts);
132
132
  });
133
133
  }
134
134
 
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.27.19",
4
+ "version": "1.27.21",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",