fix: replaced post name with its id in URLs

This commit is contained in:
Florian Sylvain
2024-06-12 16:23:33 +02:00
parent 46b816a8af
commit eb98a1003e
4 changed files with 17 additions and 14 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ import (
"html/template"
"net/http"
"regexp"
"strconv"
)
type PostCreatePageError struct {
@@ -47,7 +48,7 @@ func PostPostCreatePage(w http.ResponseWriter, r *http.Request) {
return
}
http.Redirect(w, r, "/post/"+post.Title+"/edit", http.StatusSeeOther)
http.Redirect(w, r, "/post/"+strconv.Itoa(int(post.ID))+"/edit", http.StatusSeeOther)
}
func GetPostCreatePage(w http.ResponseWriter, _ *http.Request) {