Incorrect reference to indexing

master
Mark Moffat 2019-06-15 15:26:51 +09:30
parent e68be9aa14
commit 0fe5b8fb9c
4 changed files with 8 additions and 4 deletions

View File

@ -1,6 +1,7 @@
const express = require('express');
const common = require('../lib/common');
const { restrict, checkAccess } = require('../lib/auth');
const { indexOrders } = require('../lib/indexing');
const router = express.Router();
// Show orders
@ -140,7 +141,7 @@ router.get('/admin/order/delete/:id', restrict, (req, res) => {
console.info(err.stack);
}
// remove the index
common.indexOrders(req.app)
indexOrders(req.app)
.then(() => {
// redirect home
req.session.message = 'Order successfully deleted';

View File

@ -2,6 +2,7 @@ const express = require('express');
const axios = require('axios');
const stripBom = require('strip-bom');
const common = require('../../lib/common');
const { indexOrders } = require('../lib/indexing');
const router = express.Router();
// The homepage of the site
@ -84,7 +85,7 @@ router.post('/checkout_action', (req, res, next) => {
let newId = newDoc.insertedIds['0'];
// add to lunr index
common.indexOrders(req.app)
indexOrders(req.app)
.then(() => {
// if approved, send email etc
if(orderStatus === 'Paid'){

View File

@ -1,5 +1,6 @@
let express = require('express');
let common = require('../../lib/common');
const { indexOrders } = require('../lib/indexing');
let paypal = require('paypal-rest-sdk');
let router = express.Router();
@ -76,7 +77,7 @@ router.get('/checkout_return', (req, res, next) => {
}
// add to lunr index
common.indexOrders(req.app)
indexOrders(req.app)
.then(() => {
// set the results
req.session.messageType = 'success';

View File

@ -1,5 +1,6 @@
let express = require('express');
let common = require('../../lib/common');
const { indexOrders } = require('../lib/indexing');
let numeral = require('numeral');
let stripe = require('stripe')(common.getPaymentConfig().secretKey);
let router = express.Router();
@ -64,7 +65,7 @@ router.post('/checkout_action', (req, res, next) => {
let newId = newDoc.insertedIds['0'];
// add to lunr index
common.indexOrders(req.app)
indexOrders(req.app)
.then(() => {
// if approved, send email etc
if(charge.paid === true){