Commit 5765f6fa authored by Jan Hauer's avatar Jan Hauer 🌄

Updates Server

parent ffe851d6
......@@ -6,7 +6,7 @@
<groupId>com.exxeta.demo.cars</groupId>
<artifactId>server</artifactId>
<description>Server for demo project spring boot starter</description>
<version>1.0.0</version>
<version>1.0.1</version>
<packaging>jar</packaging>
<parent>
......
......@@ -16,6 +16,7 @@ import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import static org.springframework.http.ResponseEntity.notFound;
import static org.springframework.http.ResponseEntity.unprocessableEntity;
/**
* @author Jan Hauer (EXXETA AG)
......@@ -46,7 +47,7 @@ public class CustomerController {
return repository
.save(person)
.map(ResponseEntity::ok) //
.defaultIfEmpty(notFound().build());
.defaultIfEmpty(unprocessableEntity().build());
}
@PutMapping("/{id}/lastName")
......
......@@ -18,6 +18,7 @@ import javax.validation.Valid;
import java.time.LocalDate;
import static org.springframework.http.ResponseEntity.notFound;
import static org.springframework.http.ResponseEntity.unprocessableEntity;
/**
* @author Jan Hauer (EXXETA AG)
......@@ -43,7 +44,7 @@ public class VehicleController {
return repository
.save(vehicle)
.map(ResponseEntity::ok) //
.defaultIfEmpty(notFound().build());
.defaultIfEmpty(unprocessableEntity().build());
}
@GetMapping("/{vin}")
......
Markdown is supported
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