Introduce middleware for parsing ID from URI

This commit is contained in:
eikendev 2020-08-02 17:06:11 +02:00
parent e1cd2d2f8e
commit 018ce2e537
No known key found for this signature in database
GPG key ID: A1BDB1B28C8EF694
8 changed files with 74 additions and 50 deletions

View file

@ -31,7 +31,7 @@ type NotificationHandler struct {
func (h *NotificationHandler) CreateNotification(ctx *gin.Context) {
var notification model.Notification
if success := successOrAbort(ctx, http.StatusBadRequest, ctx.Bind(&notification)); !success {
if err := ctx.Bind(&notification); err != nil {
return
}