update db

This commit is contained in:
Christopher Arraya 2023-07-02 20:51:59 -04:00
parent 60183a37c5
commit fb0685adf9

View File

@ -12,10 +12,15 @@ let client =
: { conn: null, promise: null };
if (!client.promise) {
client.promise = MongoClient.connect(uri).then((mongoClient) => {
client.conn = mongoClient;
return mongoClient;
});
client.promise = MongoClient.connect(uri)
.then((mongoClient) => {
client.conn = mongoClient;
return mongoClient;
})
.catch((error) => {
console.error("Failed to connect to MongoDB", error);
throw error;
});
}
export default client;