diff --git a/db/captchas.js b/db/captchas.js index 2d923153..4318f0ae 100644 --- a/db/captchas.js +++ b/db/captchas.js @@ -8,25 +8,25 @@ module.exports = { db, findOne: (id) => { - return captcha.findOne({ '_id': id }); + return db.findOne({ '_id': id }); }, insertOne: (text) => { - return captcha.insertOne({ + return db.insertOne({ 'text': text, 'expireAt': new Date() }); }, findOneAndDelete: (id, text) => { - return captcha.findOneAndDelete({ + return db.findOneAndDelete({ '_id': id, 'text': text }); }, deleteAll: () => { - return captcha.deleteMany({}); + return db.deleteMany({}); }, } diff --git a/models/pages/captcha.js b/models/pages/captcha.js index 40c6b1da..892cb0a6 100644 --- a/models/pages/captcha.js +++ b/models/pages/captcha.js @@ -1,6 +1,6 @@ 'use strict'; -const { Captchas, Ratelimits } = require(__dirname+'/../../db/ratelimits.js') +const { Captchas, Ratelimits } = require(__dirname+'/../../db/') , generateCaptcha = require(__dirname+'/../../helpers/captcha/captchagenerate.js'); module.exports = async (req, res, next) => {