erp2goods.js
445 Bytes
'use strict';
const mRoot = '../models';
const service = require(`${mRoot}/erp2goods-service`);
const find = (req, res, next) => {
let skn = req.query.skn || '';
let sku = req.query.sku || '';
service.find({
skn: skn,
sku: sku
}).then((result) => {
if (result.url) {
return res.redirect(result.url);
}
return next();
}).catch(next);
};
module.exports = {
find
};