diff --git a/pkg/api/obligations.go b/pkg/api/obligations.go index 08d92eb..c095be6 100644 --- a/pkg/api/obligations.go +++ b/pkg/api/obligations.go @@ -552,7 +552,7 @@ func ImportObligations(c *gin.Context) { md5hash := hex.EncodeToString(hash[:]) ob.Md5 = md5hash - var oldObligation models.Obligation + oldObligation := ob result := tx. Where(&models.Obligation{Topic: ob.Topic}). Or(&models.Obligation{Md5: ob.Md5}). diff --git a/pkg/models/types.go b/pkg/models/types.go index 66c5528..7863aa7 100644 --- a/pkg/models/types.go +++ b/pkg/models/types.go @@ -331,7 +331,7 @@ type ObligationImportRequest struct { ObligationFile string `form:"file"` } -// Obligation represents an obligation record in the import json file. +// ObligationImport represents an obligation record in the import json file. type ObligationImport struct { Topic string `json:"topic" example:"copyleft" validate:"required"` // binding:"required" tag cannot be used as is works only for request body Type string `json:"type" enums:"obligation,restriction,risk,right" validate:"required"`