Skip to content

Instantly share code, notes, and snippets.

@mandric
Created November 22, 2011 20:57
Show Gist options
  • Save mandric/1386934 to your computer and use it in GitHub Desktop.
Save mandric/1386934 to your computer and use it in GitHub Desktop.
/**
* Update functions to be exported from the design doc.
*/
var _ = require('underscore')._
exports.add_sms = function (doc, req) {
// add validation
var new_doc = _.extend(req.form, {_id: req.uuid});
// support Ushahidi response protocol
return [new_doc, '{"payload": {"success": true}}'];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment