apostrophe-schema-widgets
Advanced tools
Comparing version 0.5.14 to 0.5.15
12
index.js
@@ -47,3 +47,9 @@ var _ = require('lodash'); | ||
return schemas.convertFields(req, options.schema, 'form', item, object, function(err) { | ||
return callback(err, object); | ||
if (err) { | ||
return callback(err, object); | ||
} | ||
return widget.afterConvertFields(req, object, function(e) { | ||
return callback(e, object); | ||
}); | ||
}); | ||
@@ -60,2 +66,6 @@ }; | ||
widget.afterConvertFields = function(req, object, callback) { | ||
return callback(null); | ||
}; | ||
widget.load = function(req, item, callback) { | ||
@@ -62,0 +72,0 @@ if (req.aposSchemaWidgetLoading) { |
{ | ||
"name": "apostrophe-schema-widgets", | ||
"version": "0.5.14", | ||
"version": "0.5.15", | ||
"description": "An easy form widget builder for the Apostrophe content management system", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -146,1 +146,10 @@ # apostrophe-schema-widgets | ||
You also have `afterConvertFields` available to you for treating fields after they are sanitized. You can use it in `index.js` like this: | ||
```javascript | ||
self.widgets.menuBuilder.afterConvertFields = function(req, item, callback) { | ||
// Do stuff to your fields here | ||
return callback(null); | ||
} | ||
``` | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14445
178
155
1