forms-angular 0.12.0-beta.201 → 0.12.0-beta.202

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.
@@ -626,9 +626,12 @@ class FormsAngular {
626
626
  models() {
627
627
  const that = this;
628
628
  return function (req, res) {
629
- // TODO: Make this less wasteful - we only need to send the resourceNames of the resources
630
629
  // Check for optional modelFilter and call it with the request and current list. Otherwise just return the list.
631
- res.send(that.options.modelFilter ? that.options.modelFilter.call(null, req, that.resources) : that.resources);
630
+ let resources = that.options.modelFilter ? that.options.modelFilter.call(null, req, that.resources) : that.resources;
631
+ if (req.query?.resourceNamesOnly) {
632
+ resources = resources.map((r) => r.resourceName);
633
+ }
634
+ res.send(resources);
632
635
  };
633
636
  }
634
637
  ;
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.201",
6
+ "version": "0.12.0-beta.202",
7
7
  "engines": {
8
8
  "node": ">=8.x",
9
9
  "npm": ">=5.x"
@@ -59,6 +59,7 @@
59
59
  "devDependencies": {
60
60
  "@types/angular": "1.8.4",
61
61
  "@types/lodash": "4.14.191",
62
+ "@types/mocha": "^10.0.1",
62
63
  "@types/node": "^18.11.13",
63
64
  "angular-mocks": "1.8.3",
64
65
  "body-parser": "1.20.1",