Commit a5f2a475 authored by Juraj Fiala's avatar Juraj Fiala
Browse files

fix: Fix updating existing countries

parent e2713f80
Pipeline #142552 waiting for manual action with stage
......@@ -53,8 +53,10 @@ public class CountryController {
}
@PutMapping("/{id}")
public void updateCountry(@PathVariable("id") String id, @RequestBody CountryUpdateDTO countryDTO) {
countryService.update(beanMappingService.map(countryDTO, Country.class));
public void updateCountry(@PathVariable("id") String id, @RequestBody CountryUpdateDTO countryUpdateDTO) {
var country = beanMappingService.map(countryUpdateDTO, Country.class);
country.setId(id);
countryService.update(country);
}
@PostMapping()
......
Supports Markdown
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