Commit 63c10eb5 authored by Alexandre Ducarne's avatar Alexandre Ducarne

Remove useless slash in routes

parent 271dad37
......@@ -17,7 +17,7 @@ public class AccountController {
@Autowired
private AccountRepository accountRepository;
@PutMapping(path="/")
@PutMapping
public ResponseEntity<Account> create(@RequestBody AccountRequest accountRequest) {
Account account = Account.builder()
.email(accountRequest.getEmail())
......@@ -38,13 +38,13 @@ public class AccountController {
.orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));
}
@GetMapping(path="/")
@GetMapping
public @ResponseBody
Iterable<Account> getAll() {
return accountRepository.findAll();
}
@DeleteMapping(path="/{id}")
@DeleteMapping(path = "/{id}")
public ResponseEntity<Integer> delete(@PathVariable int id) {
try {
accountRepository.deleteById(id);
......
......@@ -17,7 +17,7 @@ public class ConsultationController {
@Autowired
private ConsultationRepository consultationRepository;
@PutMapping(path = "/")
@PutMapping
public @ResponseBody
Consultation create(@RequestBody Consultation consultation)
{
......@@ -28,7 +28,7 @@ public class ConsultationController {
: new Consultation();
}
@GetMapping(path = "/")
@GetMapping
public @ResponseBody
Iterable<Consultation> getAll()
{
......
......@@ -16,7 +16,7 @@ public class PropositionController {
@Autowired
private PropositionRepository propositionRepository;
@PutMapping(path = "/")
@PutMapping
public @ResponseBody
ResponseEntity<Proposition> create(@RequestBody Proposition proposition)
{
......@@ -25,7 +25,7 @@ public class PropositionController {
: new ResponseEntity<>(null, HttpStatus.BAD_REQUEST);
}
@GetMapping(path = "/")
@GetMapping
public @ResponseBody
Iterable<Proposition> getAll()
{
......
......@@ -14,7 +14,7 @@ public class SubjectController {
@Autowired
private SubjectRepository subjectRepository;
@PutMapping(path = "/")
@PutMapping
public @ResponseBody
Subject create(@RequestBody Subject subject) {
return subjectRepository.save(subject);
......@@ -28,7 +28,7 @@ public class SubjectController {
.orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));
}
@GetMapping(path = "/")
@GetMapping
public @ResponseBody
Iterable<Subject> getAll() {
return subjectRepository.findAll();
......
......@@ -19,7 +19,7 @@ public class UserController {
@Autowired
private AccountRepository accountRepository;
@PutMapping(path="/")
@PutMapping
public @ResponseBody
User add(@RequestBody User user) {
user.getAccount().setCreationDate(LocalDate.now());
......@@ -36,7 +36,7 @@ public class UserController {
.orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));
}
@GetMapping(path="/")
@GetMapping
public @ResponseBody
Iterable<User> getAll() {
return userRepository.findAll();
......@@ -53,7 +53,7 @@ public class UserController {
return new ResponseEntity<>(id, HttpStatus.OK);
}
@PatchMapping(path = "/")
@PatchMapping
public ResponseEntity<User> update(@RequestBody User user) {
return new ResponseEntity<>(userRepository.save(user), HttpStatus.OK);
}
......
......@@ -19,7 +19,7 @@ public class VoteController {
@Autowired
private VoteRepository voteRepository;
@PutMapping(path = "/")
@PutMapping
public ResponseEntity<Vote> create(@RequestBody Vote vote) {
try {
handleChoice(vote.getChoice(), vote.getProposition().getId());
......@@ -37,7 +37,7 @@ public class VoteController {
.orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));
}
@GetMapping(path = "/")
@GetMapping
public @ResponseBody
Iterable<Vote> getAll() {
return voteRepository.findAll();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment