From 01e7d8fd90ce64aa5ec04d71771525ebaabf0628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lyas=20Keskin?= Date: Sun, 8 Sep 2024 02:52:15 +0300 Subject: [PATCH] add await --- client/lib/actions/user.actions.js | 2 +- client/lib/database/index.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/lib/actions/user.actions.js b/client/lib/actions/user.actions.js index fa07d7a..ae3671d 100644 --- a/client/lib/actions/user.actions.js +++ b/client/lib/actions/user.actions.js @@ -12,7 +12,7 @@ import { dataURLtoBlob } from "../helpers/dataURLtoBlob"; import User from "../database/models/user.model"; export async function checkUser(email) { - connectToDatabase(); + await connectToDatabase(); console.log(email); diff --git a/client/lib/database/index.js b/client/lib/database/index.js index 2680c39..afbf605 100644 --- a/client/lib/database/index.js +++ b/client/lib/database/index.js @@ -15,7 +15,8 @@ export const connectToDatabase = async () => { cached.promise || mongoose.connect(MONGODB_URI, { dbName: "buzzys", - bufferCommands: false, + useNewUrlParser: true, + useUnifiedTopology: true, }); cached.conn = await cached.promise;