refactor to setters TODO, ingredientController
This commit is contained in:
parent
4a902ead20
commit
fef20ec876
2 changed files with 5 additions and 2 deletions
|
|
@ -50,6 +50,10 @@ public class Ingredient {
|
||||||
+ carbsPer100g * KCAL_PER_GRAM_CARBS
|
+ carbsPer100g * KCAL_PER_GRAM_CARBS
|
||||||
+ fatPer100g * KCAL_PER_GRAM_FAT;
|
+ fatPer100g * KCAL_PER_GRAM_FAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setId(long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -134,8 +134,7 @@ public class IngredientController {
|
||||||
return ResponseEntity.notFound().build();
|
return ResponseEntity.notFound().build();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Refactor to use setters
|
updated.setId(id);
|
||||||
updated.id = id;
|
|
||||||
Ingredient savedIngredient = ingredientRepository.save(updated);
|
Ingredient savedIngredient = ingredientRepository.save(updated);
|
||||||
messagingTemplate.convertAndSend(Topics.INGREDIENTS, new CreateIngredientMessage(savedIngredient));
|
messagingTemplate.convertAndSend(Topics.INGREDIENTS, new CreateIngredientMessage(savedIngredient));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue