Skip to content

Commit

Permalink
add await
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasKeskinn committed Sep 7, 2024
1 parent 682c76a commit 01e7d8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/lib/actions/user.actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion client/lib/database/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 01e7d8f

Please sign in to comment.