erp2goods.js
433 Bytes
'use strict';
const helpers = global.yoho.helpers;
const mRoot = '../models';
const service = require(`${mRoot}/erp2goods-service`);
const findBySkn = (req, res, next) => {
let skn = req.query.skn || '';
service.findBySkn(skn).then((result) => {
if (result.url) {
return res.redirect(helpers.urlFormat(result.url, null, 'item'));
}
}).catch(next);
};
module.exports = {
findBySkn
};