Skip to content

Commit

Permalink
Performed some code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
aghalarp committed Oct 31, 2013
1 parent f3fe1af commit edaaf9e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
5 changes: 2 additions & 3 deletions app/controllers/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public static Result postSurfer() {
else {
SurferFormData data = formData.get(); //Creates the object we made (SurferFormData) and fills with get data


//Create Update event. Note, should consider moving this to SurferDB addSurfer method
if (!SurferDB.slugExists(data.slug)) { //If slug does not exist yet in DB, it must be a new event
UpdateDB.addUpdate("Create", data.name);
Expand All @@ -88,7 +87,7 @@ public static Result postSurfer() {
UpdateDB.addUpdate("Edit", data.name);
}

//Add to database
//Add to database
SurferDB.addSurfer(data);

Map<String, Boolean> surferTypeMap = SurferTypes.getTypes(data.surferType);
Expand Down Expand Up @@ -120,7 +119,7 @@ public static Result deleteSurfer(String slug) {
}

/**
* Returns the show updates page.
* Returns the updates page.
* @return The updates page.
*/
public static Result getUpdates() {
Expand Down
16 changes: 0 additions & 16 deletions app/views/formdata/FootstyleTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,6 @@ public static List<String> getTypes() {
return typeList;
}

/**
* Returns a list of footstyle types with the passed footstyleType set to true.
* Assumes that footstyleType is a legal footstyle type.
* @param footstyleType The footstyle type.
* @return The footstyle type list.
*/
public static List<String> getTypes(String footstyleType) {
List<String> typeList = FootstyleTypes.getTypes();
//First checks if footstyleType is a valid type. If it is, then sets that footstyleType to true in the list.
if (isType(footstyleType)) {
typeList.add(footstyleType);
}

return typeList;
}

/**
* Returns true if footstyleType is a valid footstyle type.
* @param footstyleType The potential footstyle type.
Expand Down
1 change: 1 addition & 0 deletions app/views/formdata/SurferFormData.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public SurferFormData(Surfer surfer) {
* The Awards field is optional. It can be empty.
* The Slug field must be alphanumeric, and must be unique.
* The SurferType field must be either "Male", "Female", or "Grom".
* The footstyleType field must be either "Regular" or "Goofy".
*
*
* @return null if no errors, list of ValidationErrors if errors.
Expand Down

0 comments on commit edaaf9e

Please sign in to comment.