refac: fixed, better, smarter, correct dependency injection

This commit is contained in:
Florian Sylvain
2025-03-29 00:51:01 +01:00
parent d895477b8c
commit a77a5ad314
35 changed files with 169 additions and 144 deletions
+3 -3
View File
@@ -9,9 +9,9 @@ import (
func GetPostsPage(w http.ResponseWriter, _ *http.Request) {
posts := api.Container.ListPostsUseCase.ListPosts()
var formattedPosts []map[string]interface{}
var formattedPosts []map[string]any
for _, post := range posts {
formattedPosts = append(formattedPosts, map[string]interface{}{
formattedPosts = append(formattedPosts, map[string]any{
"ID": post.ID,
"Title": post.Title,
"IsOnline": post.IsOnline,
@@ -21,7 +21,7 @@ func GetPostsPage(w http.ResponseWriter, _ *http.Request) {
}
navbarTmpl, _ := api.Container.GetPageUseCase.GetPage("componentNavbar", nil)
postsTmpl, _ := api.Container.GetPageUseCase.GetPage("posts", map[string]interface{}{
postsTmpl, _ := api.Container.GetPageUseCase.GetPage("posts", map[string]any{
"Navbar": template.HTML(navbarTmpl),
"Head": headTmpl,
"Posts": formattedPosts,