Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
ad956 committed Jul 3, 2024
1 parent ecab573 commit 2f30be1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/api/doctor/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import dbConfig from "@utils/db";
import Doctor from "@models/doctor";

export async function GET(req: Request) {
const { searchParams } = new URL(req.url);
Expand All @@ -10,9 +11,9 @@ export async function GET(req: Request) {
});
}

const db = await dbConfig();
const doctor_collection = db.collection("doctor");
const doctor = await doctor_collection.findOne({ email });
await dbConfig();

const doctor = await Doctor.findOne({ email });

if (!doctor) {
return new Response(JSON.stringify({ error: "doctor not found" }), {
Expand Down

0 comments on commit 2f30be1

Please sign in to comment.