diff --git a/main.go b/main.go index 67624bc..7db1803 100644 --- a/main.go +++ b/main.go @@ -63,7 +63,8 @@ func main() { webfs := webfilesystem.NewWebFileSystem(client, dBName, webFsCollection) wde := wde.NewWDE(webfs) - persPropsApp := personalprops.NewPersPropsApp() + persPropsApp := personalprops.NewPersPropsApp(webfs) + persPropsApp.WriteToDb() // finderApp := finder.FinderApplication{} finderApp := finder.NewFinderApplication(webfs) imgViewerApp := imgviewer.NewImgViewerApp(webfs) @@ -186,10 +187,14 @@ func main() { persPropApp.GET("render", func(ctx *gin.Context) { isMobileParam := ctx.Query("isMobile") isMobile := isMobileParam == "true" + ginH, err := persPropsApp.Render() + if err != nil { + ctx.JSON(http.StatusInternalServerError, "TODO") //TODO + } if isMobile { - ctx.HTML(http.StatusOK, "personal-properties/mobile-app.tmpl", persPropsApp.Render()) + ctx.HTML(http.StatusOK, "personal-properties/mobile-app.tmpl", ginH) } else { - ctx.HTML(http.StatusOK, "personal-properties/app.tmpl", persPropsApp.Render()) + ctx.HTML(http.StatusOK, "personal-properties/app.tmpl", ginH) } }) } diff --git a/templates/personal-properties/app.tmpl b/templates/personal-properties/app.tmpl index 3390786..f3481aa 100644 --- a/templates/personal-properties/app.tmpl +++ b/templates/personal-properties/app.tmpl @@ -1,6 +1,6 @@ {{ define "personal-properties/app.tmpl" }} -