Fixed database check.
This commit is contained in:
parent
a0a347e0c2
commit
5d2528da5f
@ -1,7 +1,7 @@
|
|||||||
import mongoose from "mongoose";
|
import mongoose from "mongoose";
|
||||||
|
|
||||||
export function needDatabase(req, res, next) {
|
export function needDatabase(req, res, next) {
|
||||||
if (checkDatabaseConnection()) {
|
if (!checkDatabaseConnection()) {
|
||||||
res.status(500).send("Internal server error: Database connection faulty.");
|
res.status(500).send("Internal server error: Database connection faulty.");
|
||||||
} else {
|
} else {
|
||||||
next();
|
next();
|
||||||
|
Loading…
Reference in New Issue
Block a user