Skip to content
This repository has been archived by the owner on Jul 1, 2019. It is now read-only.

Commit

Permalink
Merge pull request #90 from comp3053/hot_fix
Browse files Browse the repository at this point in the history
Hot fix
  • Loading branch information
DRJ31 authored May 13, 2019
2 parents cc73488 + bd863e2 commit 0d7728b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
10 changes: 3 additions & 7 deletions src/model/Recipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public boolean insert() {
@Override
public boolean delete() {
DatabaseHelper dbHelper = new DatabaseHelper();
boolean status;
boolean status = true;
String query = String.format("DELETE FROM Recipe WHERE Recipe_ID=%d", this.getID());

try {
Expand All @@ -225,13 +225,9 @@ public boolean delete() {
e.printStackTrace();
return false;
}
for (RecipeIngredient ingredient : ingredients) {
status = ingredient.delete();
if (!status)
return false;
}
status = RecipeIngredient.deleteAll(this.getID());
notifyListener();
return true;
return status;
}

@Override
Expand Down
6 changes: 0 additions & 6 deletions src/model/RecipeForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ public boolean save() {

private boolean insert() {
recipe.setIngredients(recipeIngredients);
try {
recipe.amountConversion(batchSize, 1000);
} catch (InvalidInputException e) {
e.printStackTrace();
return false;
}
return recipe.insert();
}

Expand Down

0 comments on commit 0d7728b

Please sign in to comment.