Skip to content

Commit

Permalink
Fix admin reset route
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaHydrae committed Sep 15, 2024
1 parent 89f341a commit 21bacd5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions routes/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import * as utils from './utils.js';
const router = express.Router();

router.post('/reset', utils.authenticate, function (req, res, next) {
removeAll()
reset()
.then(() => res.sendStatus(204))
.catch(next);
});

function removeAll() {
return Movie.remove({}).then(() => Person.remove({}));
function reset() {
return Movie.deleteMany({}).then(() => Person.deleteMany({}));
}

export default router;

0 comments on commit 21bacd5

Please sign in to comment.