mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
fix: standardized ID retrieval in routes with IDs
This commit is contained in:
@@ -7,10 +7,9 @@ import (
|
||||
)
|
||||
|
||||
func GetPostDeletePage(w http.ResponseWriter, r *http.Request) {
|
||||
postId := chi.URLParam(r, "id")
|
||||
id, err := strconv.Atoi(postId)
|
||||
id, err := strconv.ParseUint(chi.URLParam(r, "id"), 10, 32)
|
||||
if err != nil {
|
||||
http.Error(w, http.StatusText(400), http.StatusBadRequest)
|
||||
http.Error(w, idUint32ErrorMessage, http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user