- Increased varchar limit from 100 to 250 on PhotoUrl
- Added profile update request for admin panel
This commit is contained in:
parent
34169e70d2
commit
b37e4bce34
@ -35,6 +35,7 @@ public class EntranceController {
|
||||
@Operation(description = "Get user's last entries. Username is taken from Authentication", summary = "Get user's last entry")
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(responseCode = "200", description = "Request Successful."),
|
||||
@ApiResponse(responseCode = "204", description = "No Entrances."),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized"),
|
||||
})
|
||||
public ResponseEntity<EntranceDTO> getLastEntrance() {
|
||||
|
@ -41,8 +41,12 @@ public class EntranceServiceImpl implements EntranceService {
|
||||
public ResponseEntity<EntranceDTO> getLastEntrance(Authentication auth) {
|
||||
Employee employee = employeeRepository.findByLogin(auth.getName());
|
||||
List<EntranceDTO> entrances = employee.getEntrances().stream().map(EntranceMapper::convertToDTO).toList();
|
||||
System.out.println(entrances.getLast());
|
||||
return new ResponseEntity<>(entrances.getLast(), HttpStatus.OK);
|
||||
if(entrances.isEmpty()) {
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
else {
|
||||
return new ResponseEntity<>(entrances.getLast(), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user