erp2goods.js
454 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 || '';
req.ctx(service).find({
skn: skn,
sku: sku
}).then((result) => {
if (result.url) {
return res.redirect(result.url);
}
return next();
}).catch(next);
};
module.exports = {
find
};