Skip to content
Snippets Groups Projects
Commit f0d681a0 authored by Jan Pokorný's avatar Jan Pokorný :lifter_tone2:
Browse files

cleaning up UserController

parent 360bb020
No related branches found
No related tags found
1 merge request!46LanguageSchool fixes + enrol expel rework
......@@ -45,7 +45,7 @@ public class UserController {
@ApiResponse(responseCode = "404", description = "User with the specified ID was not found.")
})
@GetMapping("/{id}")
public ResponseEntity<UserDto> find(@PathVariable @NotNull Long id, @AuthenticationPrincipal OAuth2IntrospectionAuthenticatedPrincipal principal) {
public ResponseEntity<UserDto> find(@PathVariable @NotNull Long id) {
try {
return ResponseEntity.ok(facade.find(id));
} catch (EntityNotFoundException e) {
......@@ -60,7 +60,7 @@ public class UserController {
@ApiResponse(responseCode = "400", description = "Invalid input.")
})
@PostMapping
public ResponseEntity<UserDto> create(@Valid @RequestBody UserCreateDto dto, @AuthenticationPrincipal OAuth2IntrospectionAuthenticatedPrincipal principal) {
public ResponseEntity<UserDto> create(@Valid @RequestBody UserCreateDto dto) {
UserDto user = facade.create(dto);
return ResponseEntity.status(HttpStatus.CREATED).body(user);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment