fixed client delete

pull/165/merge
Justin Richer 2012-08-10 17:23:31 -04:00
parent 5e898a7b0b
commit 484abc4915
1 changed files with 3 additions and 3 deletions

View File

@ -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);
} }