Added ability to add a validation function to a Cloud Code function
This commit is contained in:
5
index.js
5
index.js
@@ -113,14 +113,17 @@ function ParseServer(args) {
|
||||
|
||||
function addParseCloud() {
|
||||
Parse.Cloud.Functions = {};
|
||||
Parse.Cloud.Validators = {};
|
||||
Parse.Cloud.Triggers = {
|
||||
beforeSave: {},
|
||||
beforeDelete: {},
|
||||
afterSave: {},
|
||||
afterDelete: {}
|
||||
};
|
||||
Parse.Cloud.define = function(functionName, handler) {
|
||||
|
||||
Parse.Cloud.define = function(functionName, handler, validationHandler) {
|
||||
Parse.Cloud.Functions[functionName] = handler;
|
||||
Parse.Cloud.Validators[functionName] = validationHandler;
|
||||
};
|
||||
Parse.Cloud.beforeSave = function(parseClass, handler) {
|
||||
var className = getClassName(parseClass);
|
||||
|
||||
Reference in New Issue
Block a user