Created
October 28, 2022 15:20
-
-
Save WoolDoughnut310/d2afec2002af52cbf68eeb600a546e0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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