Permalink
Browse files

fix: supply missing orm parameter to generateIndex in /reindex

  • Loading branch information...
LordSputnik committed Jul 9, 2017
1 parent 41023d6 commit db0fb285bd6d106e5864f9c24862a4f28b640c34
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/server/routes/search.js
@@ -76,6 +76,7 @@ router.get('/autocomplete', (req, res) => {
* @throws {error.PermissionDeniedError} - Thrown if user is not admin.
*/
router.get('/reindex', auth.isAuthenticated, (req, res) => {
const {orm} = req.app.locals;
const indexPromise = new Promise((resolve) => {
// TODO: This is hacky, and we should replace it once we switch to SOLR.
const trustedUsers = ['Leftmost Cat', 'LordSputnik'];
@@ -87,7 +88,7 @@ router.get('/reindex', auth.isAuthenticated, (req, res) => {
resolve();
})
.then(() => search.generateIndex())
.then(() => search.generateIndex(orm))
.then(() => ({success: true}));
handler.sendPromiseResult(res, indexPromise);

0 comments on commit db0fb28

Please sign in to comment.