Skip to content

Commit

Permalink
Merge branch 'small-changes-and-debugging' of https://github.com/CSC2…
Browse files Browse the repository at this point in the history
  • Loading branch information
SalehYasin-2004 committed Dec 5, 2022
2 parents 2d5a849 + 7088bbe commit a5bf55f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/java/UseCases/GroupCreate.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private User getUserFromDb(String username){
if (!this.userDsInterface.userIdExists(username)){
throw new RuntimeException("User Id does not exist");
}
String userString;
String userString = "";
userString = this.userDsInterface.userAsString(username);
return User.fromString(userString);
} catch (IOException | ParseException e) {
Expand All @@ -102,7 +102,7 @@ private Group getGroupFromDb(String groupId){
if (this.groupDsInterface.groupIdExists(groupId)){
throw new RuntimeException("Invalid GroupID provided");
}
String groupString;
String groupString = "";
Group group;
groupString = this.groupDsInterface.groupAsString(groupId);
group = Group.fromString(groupString);
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/UseCases/GroupJoin.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public GroupJoin(GroupJoinBoundaryOut presenter, GroupDataInterface groupDsInter
@Override
public JoinedGroupInfo joinGroup(JoinGroupRequest reqGroupInfo){
//obtain the user from the database
User user;
User user = null;
try{
user = this.getUserFromDb(reqGroupInfo.getUsername());
}catch (RuntimeException | IOException | ParseException e) {
Expand Down Expand Up @@ -120,7 +120,7 @@ private Group getGroupFromDb(String groupId) throws IOException, ParseException
throw new RuntimeException("Invalid GroupID provided");
}
String groupString = this.groupDsInterface.groupAsString(groupId);
Group group;
Group group = null;
try {
group = Group.fromString(groupString);
} catch (JsonProcessingException e) {
Expand Down Expand Up @@ -183,8 +183,8 @@ private void saveData(User user, Group group){

private JoinedGroupInfo createOutputData(User user, Group group){
List<String> groupNames = new ArrayList<>();
List<List<String>> planningList;
List<List<String>> purchasedList;
List<List<String>> planningList = new ArrayList<>();
List<List<String>> purchasedList = new ArrayList<>();

List<String> usersInGroup = new ArrayList<>(group.getUsers());
List<String> groupIds = new ArrayList<>(user.getGroups());
Expand Down

0 comments on commit a5bf55f

Please sign in to comment.