mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-02-21 09:43:57 +08:00
fixed error insert using wrong function
This commit is contained in:
parent
87e3333c12
commit
6f001ffc27
1 changed files with 2 additions and 2 deletions
|
|
@ -8,7 +8,7 @@ const cors = require("cors");
|
|||
const admin = require("firebase-admin");
|
||||
|
||||
const serviceAccount = require("./credentials/serviceAccountKey.json");
|
||||
const { connectDB } = require("./init/mongodb");
|
||||
const { connectDB, mongoDB } = require("./init/mongodb");
|
||||
|
||||
const PORT = process.env.PORT || 5005;
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ app.use(function (e, req, res, next) {
|
|||
}
|
||||
let monkeyError = new MonkeyError(e.status, e.message, e.stack, uid);
|
||||
if (process.env.MODE !== "dev" && monkeyError.status > 400) {
|
||||
connectDB().collection("errors").insertOne({
|
||||
mongoDB().collection("errors").insertOne({
|
||||
_id: monkeyError.errorID,
|
||||
timestamp: Date.now(),
|
||||
status: monkeyError.status,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue