POST /api/ideas
Content-Type: application/json
{
"title": "Nova Feature",
"description": "Adicionar um botão de compartilhamento nas redes sociais.",
"status": "nova",
"isPinned": false,
"userId": 1
}
201 Created
Content-Type: application/json
{
"id": 1,
"title": "Nova Feature",
"description": "Adicionar um botão de compartilhamento nas redes sociais.",
"status": "nova",
"isPinned": false,
"createdAt": "2024-10-02T12:00:00Z",
"updatedAt": "2024-10-02T12:00:00Z",
"userId": 1
}
200 OK
Content-Type: application/json
[
{
"id": 1,
"title": "Nova Feature",
"description": "Adicionar um botão de compartilhamento.",
"status": "nova",
"isPinned": false,
"createdAt": "2024-10-02T12:00:00Z",
"updatedAt": "2024-10-02T12:00:00Z",
"userId": 1
},
{
"id": 2,
"title": "Melhoria na Performance",
"description": "Otimizar o carregamento da página inicial.",
"status": "nova",
"isPinned": true,
"createdAt": "2024-10-01T11:00:00Z",
"updatedAt": "2024-10-01T11:00:00Z",
"userId": 2
}
]
POST /api/votes
Content-Type: application/json
{
"userId": 1,
"ideaId": 1,
"isUpvote": true
}
201 Created
Content-Type: application/json
{
"id": 1,
"userId": 1,
"ideaId": 1,
"isUpvote": true,
"createdAt": "2024-10-02T12:00:00Z"
}
POST /api/comments
Content-Type: application/json
{
"userId": 1,
"ideaId": 1,
"content": "Acho que essa ideia é ótima!"
}
201 Created
Content-Type: application/json
{
"id": 1,
"userId": 1,
"ideaId": 1,
"content": "Acho que essa ideia é ótima!",
"createdAt": "2024-10-02T12:00:00Z"
}
PATCH /api/ideas/1/pin
Content-Type: application/json
{
"isPinned": true
}
200 OK
Content-Type: application/json
{
"id": 1,
"title": "Nova Feature",
"description": "Adicionar um botão de compartilhamento nas redes sociais.",
"status": "nova",
"isPinned": true,
"createdAt": "2024-10-02T12:00:00Z",
"updatedAt": "2024-10-02T12:00:00Z",
"userId": 1
}