Add Vote to post

Vote on a post

POST
/votes
AuthorizationBearer <token>

JWT Bearer token authentication

In: header

postIdstring

ID of the post to vote on.

Response Body

curl -X POST "http://localhost:8000/api/v1/votes" \  -H "Content-Type: application/json" \  -d '{    "postId": "string"  }'
{
  "voters": {
    "votes": [
      {
        "voteId": "string",
        "userId": "string",
        "postId": "string",
        "createdAt": "2025-09-23T13:28:01.611Z",
        "name": "string",
        "username": "string",
        "avatar": "string"
      }
    ],
    "votesCount": 10,
    "viewerVote": {
      "voteId": "string",
      "userId": "string",
      "postId": "string",
      "createdAt": "2025-09-23T13:28:01.611Z"
    }
  }
}
{
  "message": "You do not have permission to perform this action.",
  "code": "NOT_ENOUGH_PERMISSION"
}
{
  "message": "Post not found",
  "code": "POST_NOT_FOUND"
}
{
  "message": "Vote already exists",
  "code": "VOTE_EXISTS"
}
{
  "message": "Something went wrong!",
  "code": "SERVER_ERROR"
}