Skip to content

Instantly share code, notes, and snippets.

@WoolDoughnut310
Created October 28, 2022 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WoolDoughnut310/d2afec2002af52cbf68eeb600a546e0d to your computer and use it in GitHub Desktop.
Save WoolDoughnut310/d2afec2002af52cbf68eeb600a546e0d to your computer and use it in GitHub Desktop.
router.delete(
"/:id",
asyncHandler(async (req: Request, res: Response) => {
const db = getDb();
const collection = db.collection<Song>("song");
await collection.deleteOne({ userId: req.auth.id, _id: req.body.id });
res.status(200).json("Deleted successfully");
})
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment