added info to meal

This commit is contained in:
2025-10-25 16:17:50 +02:00
parent 38db9c242b
commit b8046c87b9
4 changed files with 465 additions and 57 deletions

14
main.go
View File

@@ -94,6 +94,20 @@ func main() {
} else {
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
}
} else if strings.Contains(path, "/edit") {
// Meal edit route
if r.Method == "GET" {
handlers.GetEditMealHandler(w, r)
} else {
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
}
} else if strings.Contains(path, "/update") {
// Meal update route
if r.Method == "POST" {
handlers.UpdateMealHandler(w, r)
} else {
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
}
} else {
// Meal delete route
if r.Method == "DELETE" {