feat: validation, postgress connection,
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user