Products
getProducts
module.exports.getProducts = () => {
return async (req, res) => {
const domain = req.subdomains[0] || "dev";
let _query = { domain };
const query = req.query;
if (query && Object.keys(query).length) {
delete query.nd;
// _query = Object.assign(_query, ob.querystring.parse(query));
_query = { ..._query, ...query};
}
res.set('Cache-Control', 'no-cache');
const user = req.user;
ob.log(_query);
const products = await xe.Product.find(_query);
res.json(products);
};
};Last updated