PugJS adding question mark in form action
form(method="DELETE", action='/shortener/'+ item._id)
button.btn.btn-delete(type="submit") Delete
The URL I get:
http://localhost:8080/shortener/6421f534e7c2fbc3293e83ad?
I also tried to get the url using fetch()
public async destroy(req: Request, res: Response): Promise<Response> {
await Shortener.findOneAndDelete({ _id: req.params.id });
return res.status(204).json([]);
}