ADD::added more comments

This commit is contained in:
Sem van der Hoeven
2019-03-18 20:47:34 +01:00
parent 2c54b8d68c
commit 920c7c798d
4 changed files with 22 additions and 6 deletions

View File

@@ -29,7 +29,7 @@ public class RegisterWindowController {
/**
* signs the user up.
* @param event the click of the signup button
* @param event the click of the sign up button
*/
@FXML
public void handleSignUpButton(ActionEvent event) {
@@ -59,6 +59,7 @@ public class RegisterWindowController {
return;
}
//register the user with the provided username and password
userService.registerUser(userNameText.getText(), passwordField.getText());
//close the register window after the user has entered all the credentials

View File

@@ -58,7 +58,7 @@ public class UserController {
if (passwordField.getText().isEmpty()) {
AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Log-in Error!",
"Please enter a password");
//checks if the password field id filled,
//checks if the password field is filled,
// and gives an alert if it is not.
return;
} else {
@@ -117,9 +117,11 @@ public class UserController {
}
/**
* The method handles register button.
* @param event User clicks to the button
* @throws Exception when the file couldn't be found
* The method handles the clicking of the register button.
* it then opens the register window where the user can register
* (handled by RegisterWindowController)
* @param event User clicks on the button
* @throws Exception when the fxml file couldn't be found
*/
public void handleRegisterButtonAction(ActionEvent event) throws Exception {
Parent registerWindow = Application.load(this.getClass().getClassLoader()

View File

@@ -51,6 +51,7 @@ public class UserService {
System.out.println(builder.build().encode().toUri());
//the result to be sent is a userDto
//encodes the userDTO object to a Uri so the database can work with it
UserDto result = this.restTemplate.getForObject(builder.build()
.encode().toUri(), UserDto.class);
this.currentUser = result;