Ajouter route POST admin documents upload

This commit is contained in:
Victor Lacasse-Beaudoin 2023-04-26 19:43:43 -04:00
parent a1146d182f
commit fd3eebb68c
2 changed files with 13 additions and 0 deletions

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 }}