async function deletePost(req, res, next) {
  try {
    const post = await Post.findById(req.params.id);

    if (post.author.toString() !== req.user._id.toString()) {
      return res.sendStatus(HTTPStatus.UNAUTHORIZED);
    }
    await post.remove();
    return res.sendStatus(HTTPStatus.OK);
  } catch (err) {
    err.status = HTTPStatus.BAD_REQUEST;
    return next(err);
  }
}
@api {delete} /posts/:id Delete a post
@apiDescription Delete a post if the author it's the right one
@apiName deletePost
@apiGroup Post

@apiHeader {Authorization} Authorization JWT Token

@apiParam {String} id Post unique ID.

@apiParam (Login) {String} pass Only logged in users can do this.

@apiSuccess {Number} status Status of the Request.

@apiHeaderExample {json} Header-Example:
{
 "AUTHORIZATION": "JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1OTBhMWI3ODAzMDI3N2NiNjQxM2JhZGUiLCJpYXQiOjE0OTM4MzQ2MTZ9.RSlMF6RRwAALZQRdfKrOZWnuHBk-mQNnRcCLJsc8zio"
}

@apiSuccessExample Success-Response:

HTTP/1.1 200 OK

200

@apiErrorExample {json} Post not found
   HTTP/1.1 404 Not Found
@apiErrorExample {json} Unauthorized
   HTTP/1.1 401 Unauthorized