Skip to content
Snippets Groups Projects
Commit 2502ca5e authored by Tom Käsler's avatar Tom Käsler Committed by Daniel Gerhardt
Browse files

Swap PUT/POST logic

See !75.
parent ec67f9be
Branches
No related merge requests found
......@@ -68,13 +68,13 @@ public abstract class AbstractEntityController<E extends Entity> {
@PutMapping(PUT_MAPPING)
public void put(@RequestBody final E entity) {
entityService.create(entity);
E oldEntity = entityService.get(entity.getId());
entityService.update(oldEntity, entity);
}
@PostMapping(POST_MAPPING)
public void post(@RequestBody final E entity) {
E oldEntity = entityService.get(entity.getId());
entityService.update(oldEntity, entity);
entityService.create(entity);
}
@PatchMapping(PATCH_MAPPING)
......
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