Skip to content

Commit 0d63b1e

Browse files
committed
fixed reference to UserDatabase methods
1 parent e523238 commit 0d63b1e

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
public interface Changable {
1+
public interface Changeable {
22
public void changeFeature(String feature, String newFeature);
33
}

src/main/java/UserModificationUI.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
public class UserModificationUI implements ChangeController{
1010
private JLabel label;
11+
UserDatabase db = UserDatabase(accounts);
1112
public UserModificationUI() {
1213
final JFrame frame = new JFrame();
1314
frame.setSize(1200, 100);
@@ -65,20 +66,18 @@ public void actionPerformed(ActionEvent e) {
6566
@Override
6667
// TODO: fix based on new UserDatabase/ getUser features
6768
public boolean reportChange(String username, String password, String feature, String newFeature) {
68-
if (userDatabase.UserExists(username)){
69-
User user = userDatabase.getUser(username);
70-
if (user.getPassword().equals(password) && user.getUsername().equals(username)){
71-
user.changeFeature(feature, newFeature);
72-
return true;
73-
}
69+
User user = db.getUser(username);
70+
if (user.getPassword().equals(password) && user.getUsername().equals(username)){
71+
user.changeFeature(feature, newFeature);
72+
return true;
7473
}
7574
return false;
7675
}
7776

7877
// for trying out the code:
79-
public static void main(String[] args) {
80-
new UserModificationUI();
81-
82-
}
78+
// public static void main(String[] args) {
79+
// new UserModificationUI();
80+
//
81+
// }
8382

8483
}

0 commit comments

Comments
 (0)