From 0e3058e39faf9cadf5b88d6d620d92ac09f88d00 Mon Sep 17 00:00:00 2001 From: Jon Sundin Date: Wed, 31 Jan 2024 01:48:55 +0000 Subject: [PATCH] added findAccountByAccountId, flipped conditional check in accountIsRegistered --- src/main/java/Service/AccountService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/Service/AccountService.java b/src/main/java/Service/AccountService.java index a32a423..9ef5100 100644 --- a/src/main/java/Service/AccountService.java +++ b/src/main/java/Service/AccountService.java @@ -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) {