Ajouter upload de fichier par form html #49

Merged
vlbeaudoin merged 7 commits from feature/admin-route into main 2023-04-28 19:33:30 -04:00
2 changed files with 13 additions and 0 deletions
Showing only changes of commit fd3eebb68c - Show all commits

View file

@ -201,6 +201,8 @@ func RunServer() {
groupAdmin.GET("/documents/upload", handleAdminDocumentsUpload) groupAdmin.GET("/documents/upload", handleAdminDocumentsUpload)
groupAdmin.POST("/documents/upload", handleAdminDocumentsUploadPOST)
e.Logger.Fatal(e.Start( e.Logger.Fatal(e.Start(
fmt.Sprintf(":%d", viper.GetInt("server.port")))) fmt.Sprintf(":%d", viper.GetInt("server.port"))))
} }
@ -726,6 +728,16 @@ func handleAdminDocumentsUpload(c echo.Context) error {
return c.Render(http.StatusOK, "admin-upload-html", nil) return c.Render(http.StatusOK, "admin-upload-html", nil)
} }
func handleAdminDocumentsUploadPOST(c echo.Context) error {
data := struct {
Message string
}{
Message: "Pas implémenté",
}
return c.Render(http.StatusOK, "admin-upload-html", data)
}
// CSS Handlers // CSS Handlers
func handleStaticCSSIndex(c echo.Context) error { func handleStaticCSSIndex(c echo.Context) error {

View file

@ -9,6 +9,7 @@
<body> <body>
{{ template "header-html" }} {{ template "header-html" }}
<h1>Upload</h1> <h1>Upload</h1>
<p>{{ .Message }}</p>
</body> </body>
</html> </html>
{{ end }} {{ end }}