forms-angular 0.12.0-beta.272 → 0.12.0-beta.273

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.
@@ -137,6 +137,21 @@ class FormsAngular {
137
137
  let date = that.extractTimestampFromMongoID(doc[aField.field]);
138
138
  cbm(null, date.toLocaleDateString() + ' ' + date.toLocaleTimeString());
139
139
  }
140
+ else if (!aField.params.params) {
141
+ throw new Error(`Missing idIsList params for resource ${resource.resourceName}: ${JSON.stringify(aField.params)}`);
142
+ }
143
+ else if (typeof doc[aField.params.params] === "function") {
144
+ const resultOrPromise = doc[aField.params.params]();
145
+ if (typeof resultOrPromise.then === "function") {
146
+ resultOrPromise.then((result) => cbm(null, result));
147
+ }
148
+ else {
149
+ cbm(null, resultOrPromise);
150
+ }
151
+ }
152
+ else {
153
+ throw new Error(`No support for idIsList params for resource ${resource.resourceName}: ${JSON.stringify(aField.params)}`);
154
+ }
140
155
  }
141
156
  else {
142
157
  cbm(null, doc[aField.field]);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "author": "Mark Chapman <support@forms-angular.org>",
4
4
  "description": "A form builder that sits on top of Angular.js, Twitter Bootstrap, jQuery UI, Angular-UI, Express and Mongoose. Opinionated or what?",
5
5
  "homepage": "http://forms-angular.org",
6
- "version": "0.12.0-beta.272",
6
+ "version": "0.12.0-beta.273",
7
7
  "engines": {
8
8
  "node": ">=8.x",
9
9
  "npm": ">=5.x"