Skip to content

Commit

Permalink
added findAccountByAccountId, flipped conditional check in accountIsR…
Browse files Browse the repository at this point in the history
…egistered
  • Loading branch information
jmsundin committed Jan 31, 2024
1 parent 6b75705 commit 0e3058e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/Service/AccountService.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ public boolean isValidCredentials(String username, String password) {
}

public boolean accountIsRegistered(String username) {
if (accountDAO.findAccountByUsername(username) != null) return true;
return false;
if (accountDAO.findAccountByUsername(username) == null) return false;
return true;
}

public Account findAccountByAccountId(int account_id) {
return accountDAO.findAccountByAccountId(account_id);
}

public Account login(String username, String password) {
Expand Down

0 comments on commit 0e3058e

Please sign in to comment.