UNPKG

docparse-upload-process

Version:

process upload api request for the docparse server

15 lines (14 loc) 411 B
var should = require('should'); var Supplier = require('docparse-supplier'); module.exports = function(cb) { Supplier.findOne({supplier_code: 'FGS'}, function (err, reply) { if (err) { return cb(err); } if (reply) { return cb(null, reply); } var supplier = new Supplier(); supplier.supplier_name = 'Foo Gas Supply'; supplier.supplier_code = 'FGS'; supplier.save(cb); }); }