diff --git a/internal/service/handlers/update_event_type.go b/internal/service/handlers/update_event_type.go index 02ce924..90f1075 100644 --- a/internal/service/handlers/update_event_type.go +++ b/internal/service/handlers/update_event_type.go @@ -46,7 +46,16 @@ func UpdateEventType(w http.ResponseWriter, r *http.Request) { return } - typeModel := models.ResourceToModel(req.Data.Attributes) + typeModel := *evType + model := req.Data.Attributes + typeModel.Description = model.Description + typeModel.ShortDescription = model.ShortDescription + typeModel.Reward = model.Reward + typeModel.Title = model.Title + typeModel.AutoClaim = model.AutoClaim + typeModel.Disabled = model.Disabled + typeModel.ActionURL = model.ActionUrl + typeModel.Logo = model.Logo var updated []models.EventType err = EventsQ(r).Transaction(func() error { diff --git a/internal/service/requests/update_event_type.go b/internal/service/requests/update_event_type.go index 39a6d3d..35a8a57 100644 --- a/internal/service/requests/update_event_type.go +++ b/internal/service/requests/update_event_type.go @@ -31,8 +31,8 @@ func NewUpdateEventType(r *http.Request) (req resources.EventTypeResponse, err e // not updatable, as QR code includes event type name "data/attributes/qr_code_value": val.Validate(attr.QrCodeValue, val.Empty), - "data/attributes/poll_event_id": val.Validate(attr.PollEventId, val.Nil), - "data/attributes/poll_contract": val.Validate(attr.PollContract, val.Nil), + "data/attributes/poll_event_id": val.Validate(attr.PollEventId, val.Empty), + "data/attributes/poll_contract": val.Validate(attr.PollContract, val.Empty), // these fields are not currently supported, because cron jobs implementation is required "data/attributes/starts_at": val.Validate(attr.StartsAt, val.Empty), "data/attributes/expires_at": val.Validate(attr.ExpiresAt, val.Empty),