Skip to content

Commit

Permalink
fix: supply missing orm parameter to generateIndex in /reindex
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSputnik committed Jul 9, 2017
1 parent 41023d6 commit db0fb28
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/server/routes/search.js
Expand Up @@ -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'];
Expand All @@ -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);
Expand Down

0 comments on commit db0fb28

Please sign in to comment.