Skip to content

Commit

Permalink
frontend: Account by Id
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelharlow committed Nov 6, 2024
1 parent 29a1d21 commit fe4ffd4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@ public ResponseEntity<?> findAll()
{
return new ResponseEntity<>(accountService.findAll(), HttpStatus.OK);
}

@GetMapping("/account/{id}")
public ResponseEntity<?> findById(@PathVariable long id)
{
return new ResponseEntity<>(accountService.findById(id), HttpStatus.OK);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ public Account findByEmailAndPassword(String email, String password)
{
return accountRepository.findByEmailAndPassword(email, password);
}

public Account findById(long id)
{
return accountRepository.findById(id).orElse(null);
}
}

0 comments on commit fe4ffd4

Please sign in to comment.