update operation fix
This commit is contained in:
parent
c1fed77c54
commit
f18520d30d
|
@ -85,9 +85,9 @@ public class FooController {
|
||||||
eventPublisher.publishEvent(new ResourceCreatedEvent(this, response, idOfCreatedResource));
|
eventPublisher.publishEvent(new ResourceCreatedEvent(this, response, idOfCreatedResource));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.PUT)
|
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
|
||||||
@ResponseStatus(HttpStatus.OK)
|
@ResponseStatus(HttpStatus.OK)
|
||||||
public void update(@RequestBody final Foo resource) {
|
public void update(@PathVariable("id") final Long id, @RequestBody final Foo resource) {
|
||||||
Preconditions.checkNotNull(resource);
|
Preconditions.checkNotNull(resource);
|
||||||
RestPreconditions.checkFound(service.findOne(resource.getId()));
|
RestPreconditions.checkFound(service.findOne(resource.getId()));
|
||||||
service.update(resource);
|
service.update(resource);
|
||||||
|
|
Loading…
Reference in New Issue