Remove debugging
parent
72b88eee9e
commit
8f2c1f4323
|
@ -99,8 +99,6 @@ router.get('/admin/orders/filter/:search', restrict, (req, res, next) => {
|
||||||
const searchTerm = req.params.search;
|
const searchTerm = req.params.search;
|
||||||
const ordersIndex = req.app.ordersIndex;
|
const ordersIndex = req.app.ordersIndex;
|
||||||
|
|
||||||
console.log('searchTerm', searchTerm);
|
|
||||||
|
|
||||||
const lunrIdArray = [];
|
const lunrIdArray = [];
|
||||||
ordersIndex.search(searchTerm).forEach((id) => {
|
ordersIndex.search(searchTerm).forEach((id) => {
|
||||||
lunrIdArray.push(common.getId(id.ref));
|
lunrIdArray.push(common.getId(id.ref));
|
||||||
|
@ -114,13 +112,11 @@ router.get('/admin/orders/filter/:search', restrict, (req, res, next) => {
|
||||||
|
|
||||||
// If API request, return json
|
// If API request, return json
|
||||||
if(req.apiAuthenticated){
|
if(req.apiAuthenticated){
|
||||||
console.log('returning json');
|
|
||||||
return res.status(200).json({
|
return res.status(200).json({
|
||||||
orders
|
orders
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('returning view');
|
|
||||||
return res.render('orders', {
|
return res.render('orders', {
|
||||||
title: 'Order results',
|
title: 'Order results',
|
||||||
orders: orders,
|
orders: orders,
|
||||||
|
|
Loading…
Reference in New Issue