diff --git a/app/api/delete/vulnerability/[id]/route.ts b/app/api/delete/vulnerability/[id]/route.ts index 3e1d4cc..bad8fa6 100644 --- a/app/api/delete/vulnerability/[id]/route.ts +++ b/app/api/delete/vulnerability/[id]/route.ts @@ -6,8 +6,6 @@ export async function DELETE( request: Request, { params }: { params: { id: string } } ) { - const client = await clientPromise; - const db = client.db(); const { id } = params; if (!id) { @@ -15,6 +13,8 @@ export async function DELETE( } try { + const client = await clientPromise; + const db = client.db("downloadsDatabase"); const result = await db .collection("vulnerabilities") .deleteOne({ _id: new ObjectId(id) });