feat: validation, postgress connection,

This commit is contained in:
2026-03-12 11:23:18 +01:00
parent abf2db2798
commit 56fa7b6c21
15 changed files with 269 additions and 37 deletions
+6
View File
@@ -5,6 +5,12 @@ import (
"net/http"
)
// Note that the errors parameter here has the type map[string]string, which is exactly
// the same as the errors map contained in our Validator type.
func (app *application) failedValidationResponse(w http.ResponseWriter, r *http.Request, errors map[string]string) {
app.errorResponse(w, r, http.StatusUnprocessableEntity, errors)
}
// The logError() method is a generic helper for logging an error message. “Later in the
// book we'll upgrade this to use structured logging, and record additional information
// about the request including the HTTP method and URL.