Incorrect reference to indexing
parent
e68be9aa14
commit
0fe5b8fb9c
|
@ -1,6 +1,7 @@
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
const common = require('../lib/common');
|
const common = require('../lib/common');
|
||||||
const { restrict, checkAccess } = require('../lib/auth');
|
const { restrict, checkAccess } = require('../lib/auth');
|
||||||
|
const { indexOrders } = require('../lib/indexing');
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
// Show orders
|
// Show orders
|
||||||
|
@ -140,7 +141,7 @@ router.get('/admin/order/delete/:id', restrict, (req, res) => {
|
||||||
console.info(err.stack);
|
console.info(err.stack);
|
||||||
}
|
}
|
||||||
// remove the index
|
// remove the index
|
||||||
common.indexOrders(req.app)
|
indexOrders(req.app)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// redirect home
|
// redirect home
|
||||||
req.session.message = 'Order successfully deleted';
|
req.session.message = 'Order successfully deleted';
|
||||||
|
|
|
@ -2,6 +2,7 @@ const express = require('express');
|
||||||
const axios = require('axios');
|
const axios = require('axios');
|
||||||
const stripBom = require('strip-bom');
|
const stripBom = require('strip-bom');
|
||||||
const common = require('../../lib/common');
|
const common = require('../../lib/common');
|
||||||
|
const { indexOrders } = require('../lib/indexing');
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
// The homepage of the site
|
// The homepage of the site
|
||||||
|
@ -84,7 +85,7 @@ router.post('/checkout_action', (req, res, next) => {
|
||||||
let newId = newDoc.insertedIds['0'];
|
let newId = newDoc.insertedIds['0'];
|
||||||
|
|
||||||
// add to lunr index
|
// add to lunr index
|
||||||
common.indexOrders(req.app)
|
indexOrders(req.app)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// if approved, send email etc
|
// if approved, send email etc
|
||||||
if(orderStatus === 'Paid'){
|
if(orderStatus === 'Paid'){
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
let express = require('express');
|
let express = require('express');
|
||||||
let common = require('../../lib/common');
|
let common = require('../../lib/common');
|
||||||
|
const { indexOrders } = require('../lib/indexing');
|
||||||
let paypal = require('paypal-rest-sdk');
|
let paypal = require('paypal-rest-sdk');
|
||||||
let router = express.Router();
|
let router = express.Router();
|
||||||
|
|
||||||
|
@ -76,7 +77,7 @@ router.get('/checkout_return', (req, res, next) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// add to lunr index
|
// add to lunr index
|
||||||
common.indexOrders(req.app)
|
indexOrders(req.app)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// set the results
|
// set the results
|
||||||
req.session.messageType = 'success';
|
req.session.messageType = 'success';
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
let express = require('express');
|
let express = require('express');
|
||||||
let common = require('../../lib/common');
|
let common = require('../../lib/common');
|
||||||
|
const { indexOrders } = require('../lib/indexing');
|
||||||
let numeral = require('numeral');
|
let numeral = require('numeral');
|
||||||
let stripe = require('stripe')(common.getPaymentConfig().secretKey);
|
let stripe = require('stripe')(common.getPaymentConfig().secretKey);
|
||||||
let router = express.Router();
|
let router = express.Router();
|
||||||
|
@ -64,7 +65,7 @@ router.post('/checkout_action', (req, res, next) => {
|
||||||
let newId = newDoc.insertedIds['0'];
|
let newId = newDoc.insertedIds['0'];
|
||||||
|
|
||||||
// add to lunr index
|
// add to lunr index
|
||||||
common.indexOrders(req.app)
|
indexOrders(req.app)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// if approved, send email etc
|
// if approved, send email etc
|
||||||
if(charge.paid === true){
|
if(charge.paid === true){
|
||||||
|
|
Loading…
Reference in New Issue