This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NEWSCHEMA('Form').make(function (schema) { | |
schema.define('contact', 'FormContact', true); | |
schema.define('deal', 'FormDeal', true); | |
schema.addWorkflow('submit', function (error, model, options, callback, controller) { | |
Promise.all([getDealById(options.deal_id), getContactById(options.contact_id)]) | |
.then(function (values) { | |
let valid = (values[0] && value[1]); // 0 = getDealById, 1 = getContactById | |
if (!valid) { | |
error.push('deal', 'not found.'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Example CommonJS Module Wrapped by Brunch with options, private and public methods | |
* Usage with defaults: require("brunch.commonjs.options.module")() | |
* Usage with options: require("brunch.commonjs.options.module")({myOptionName:false}) | |
*/ | |
"use strict"; | |
// require's and constants | |
const $ = require("jquery"); |
NewerOlder