diff --git a/src/main/java/com/wyattjmiller/home/recipefoliobackend/model/Recipe.java b/src/main/java/com/wyattjmiller/home/recipefoliobackend/model/Recipe.java index f1bcab1..0e3e63e 100644 --- a/src/main/java/com/wyattjmiller/home/recipefoliobackend/model/Recipe.java +++ b/src/main/java/com/wyattjmiller/home/recipefoliobackend/model/Recipe.java @@ -13,18 +13,18 @@ public class Recipe { private String Name; private String Description; private String Ingredients; - private LocalDateTime CreatedTimestamp; + private LocalDateTime CreatedTimestamp = LocalDateTime.now(); // constructors public Recipe() { } - public Recipe(String name, String description, String ingredients, LocalDateTime createdTimestamp) { + public Recipe(String name, String description, String ingredients) { this.Name = name; this.Description = description; this.Ingredients = ingredients; - this.CreatedTimestamp = createdTimestamp; + this.CreatedTimestamp = LocalDateTime.now(); } // mehtods (fields) diff --git a/src/main/java/com/wyattjmiller/home/recipefoliobackend/utils/LoadDatabase.java b/src/main/java/com/wyattjmiller/home/recipefoliobackend/utils/LoadDatabase.java index 095dfdb..b5d95b9 100644 --- a/src/main/java/com/wyattjmiller/home/recipefoliobackend/utils/LoadDatabase.java +++ b/src/main/java/com/wyattjmiller/home/recipefoliobackend/utils/LoadDatabase.java @@ -18,7 +18,7 @@ class LoadDatabase { @Bean CommandLineRunner initDatabase(RecipeRepository repository) { return args -> { - log.info("Preloading " + repository.save(new Recipe("Peanut Butter and Jelly Sandwhich", "The defacto sandwhich", "Peanut Butter, Jelly, and bread", LocalDateTime.now()))); + log.info("Preloading " + repository.save(new Recipe("Peanut Butter and Jelly Sandwhich", "The defacto sandwhich", "Peanut Butter, Jelly, and bread"))); }; } }