Merge remote-tracking branch 'origin/main'
Some checks failed
Android Test / validate-and-test (pull_request) Has been cancelled
Some checks failed
Android Test / validate-and-test (pull_request) Has been cancelled
This commit is contained in:
@@ -23,14 +23,14 @@ public class EmployeeController {
|
||||
@Autowired
|
||||
private EmployeeService employeeService;
|
||||
@GetMapping("/{code}/auth")
|
||||
public ResponseEntity<Void> checkAuth(
|
||||
public ResponseEntity<String> checkAuth(
|
||||
@PathVariable String code) {
|
||||
if (code==null){
|
||||
throw new IllegalArgumentException("Employee code is required");
|
||||
}
|
||||
try {
|
||||
employeeService.getEmployeeByCode(code);
|
||||
return ResponseEntity.ok().build();
|
||||
return ResponseEntity.ok("Authorized Employee");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
|
||||
} catch (EmployeeNotFoundException e) {
|
||||
|
||||
Reference in New Issue
Block a user