fixed client delete
parent
5e898a7b0b
commit
484abc4915
|
@ -90,9 +90,9 @@ public class ClientAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value="/{id}", method=RequestMethod.DELETE, headers="Accept=application/json")
|
@RequestMapping(value="/{id}", method=RequestMethod.DELETE, headers="Accept=application/json")
|
||||||
public String apiDeleteClient(@PathVariable("id") String id, ModelAndView modelAndView) {
|
public String apiDeleteClient(@PathVariable("id") Long id, ModelAndView modelAndView) {
|
||||||
|
|
||||||
ClientDetailsEntity client = clientService.loadClientByClientId(id);
|
ClientDetailsEntity client = clientService.getClientById(id);
|
||||||
clientService.deleteClient(client);
|
clientService.deleteClient(client);
|
||||||
|
|
||||||
return "jsonClientView";
|
return "jsonClientView";
|
||||||
|
@ -102,7 +102,7 @@ public class ClientAPI {
|
||||||
@RequestMapping(value="/{id}", method=RequestMethod.GET, headers="Accept=application/json")
|
@RequestMapping(value="/{id}", method=RequestMethod.GET, headers="Accept=application/json")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Object apiShowClient(@PathVariable("id") Long id, ModelAndView modelAndView) {
|
public Object apiShowClient(@PathVariable("id") Long id, ModelAndView modelAndView) {
|
||||||
ClientDetailsEntity client = clientService.loadClientByClientId(id.toString());
|
ClientDetailsEntity client = clientService.getClientById(id);
|
||||||
if (client == null) {
|
if (client == null) {
|
||||||
return new ResponseEntity<String>(HttpStatus.NOT_FOUND);
|
return new ResponseEntity<String>(HttpStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue