From 5d2528da5fb10792eaaf0054bba315254cdeb4cb Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Thu, 7 Apr 2022 19:22:35 -0500 Subject: [PATCH] Fixed database check. --- sports-matcher/server/middleware/database.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sports-matcher/server/middleware/database.js b/sports-matcher/server/middleware/database.js index f9ffa87..08cdf68 100644 --- a/sports-matcher/server/middleware/database.js +++ b/sports-matcher/server/middleware/database.js @@ -1,7 +1,7 @@ import mongoose from "mongoose"; export function needDatabase(req, res, next) { - if (checkDatabaseConnection()) { + if (!checkDatabaseConnection()) { res.status(500).send("Internal server error: Database connection faulty."); } else { next();