From 7a6713be4fa141fa224c6d8b628c06fc4620b6d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20PAILHAREY?= <rpailharey@grandlyon.com> Date: Tue, 4 Oct 2022 14:35:48 +0000 Subject: [PATCH] feat: added custom popup enddate --- internal/models/customPopup.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/models/customPopup.go b/internal/models/customPopup.go index db4aa73..7fa78b1 100644 --- a/internal/models/customPopup.go +++ b/internal/models/customPopup.go @@ -5,15 +5,17 @@ import ( "errors" "log" "net/http" + "time" "gorm.io/gorm" ) type CustomPopup struct { - ID uint `gorm:"<-:create"` - PopupEnabled bool `json:"popupEnabled"` - Title string `json:"title"` - Description string `json:"description"` + ID uint `gorm:"<-:create"` + PopupEnabled bool `json:"popupEnabled"` + Title string `json:"title"` + Description string `json:"description"` + EndDate time.Time `json:"endDate"` } // GetCustomPopup godoc @@ -74,6 +76,7 @@ func (dh *DataHandler) SaveCustomPopup(w http.ResponseWriter, r *http.Request) { updatedCustomPopup.PopupEnabled = customPopup.PopupEnabled updatedCustomPopup.Title = customPopup.Title updatedCustomPopup.Description = customPopup.Description + updatedCustomPopup.EndDate = customPopup.EndDate dh.sqlClient.Save(&updatedCustomPopup) -- GitLab