mirror of
https://gitlab.com/etc404/software-engineering-project.git
synced 2026-05-10 20:52:58 +00:00
Merge branch 'main' of gitlab.com:etc404/software-engineering-project
merge
This commit is contained in:
@@ -30,6 +30,10 @@ public class SiteController {
|
|||||||
|
|
||||||
@GetMapping("/")
|
@GetMapping("/")
|
||||||
public String viewHomePage(Model model, Principal principal) {
|
public String viewHomePage(Model model, Principal principal) {
|
||||||
|
List<RecipeDto> newest = recipeService.getNewestRecipes(5);
|
||||||
|
model.addAttribute("recipes", recipes);
|
||||||
|
model.addAttribute("newestRecipes", newest);
|
||||||
|
|
||||||
model.addAttribute("guest", principal == null);
|
model.addAttribute("guest", principal == null);
|
||||||
|
|
||||||
if (principal == null) {
|
if (principal == null) {
|
||||||
@@ -38,7 +42,7 @@ public class SiteController {
|
|||||||
model.addAttribute("recipes", userService.getFavoriteRecipesByUsername(principal.getName()));
|
model.addAttribute("recipes", userService.getFavoriteRecipesByUsername(principal.getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return "home";
|
return "redirect:/explore";
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/login")
|
@GetMapping("/login")
|
||||||
|
|||||||
Reference in New Issue
Block a user