Closed Kordedekehine closed 2 years ago
Can someone help me with this question? I can't send out the PollLength request. It's not working
SOLVED
{ "question": "Who is the next president of the country", "choices": [ { "opinion": "buhari" }, { "opinion": "atiku" }, { "opinion": "obi" } ], "pollLength": { "days": 2, "hours": 2 }
}
As a beginner,I've been coding along the tutorial until I finished and I realize I can't test the create poll API.
The PollRequest class @Data public class PollRequestDto {
}
The choices class
@Data public class ChoiceRequestDto {
}
The pollLenght class
@Data @NoArgsConstructor
public class PollLengthOfTimeDto {
}
These is the controller code:
@PostMapping //@PreAuthorize("hasRole('USER')") public ResponseEntity<?> createPoll(@Valid @RequestBody PollRequestDto pollRequest) { Poll poll = pollService.createPoll(pollRequest);
And these is how I've been testing it in the postman: