mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-09-08 15:41:20 +02:00
refactor: Clean up config creation handler by removing debug print statements
- Remove unnecessary print statements for form data and configuration details in the HandleCreateConfig function. - Update handling of skipProcessedFiles to use a pointer for improved clarity and functionality.
This commit is contained in:
@@ -72,16 +72,10 @@ func (h *Handlers) HandleCreateConfig(c *gin.Context) {
|
|||||||
userID := c.GetUint("userID")
|
userID := c.GetUint("userID")
|
||||||
config.CreatedBy = userID
|
config.CreatedBy = userID
|
||||||
|
|
||||||
// print entire form data
|
|
||||||
fmt.Println("Form data:", c.Request.Form)
|
|
||||||
|
|
||||||
// Process skipProcessedFiles value (now using pointer)
|
// Process skipProcessedFiles value (now using pointer)
|
||||||
skipProcessedValue := c.Request.FormValue("skip_processed_files") == "true"
|
skipProcessedValue := c.Request.FormValue("skip_processed_files") == "true"
|
||||||
config.SkipProcessedFiles = &skipProcessedValue
|
config.SkipProcessedFiles = &skipProcessedValue
|
||||||
|
|
||||||
fmt.Println("Skip processed files:", config.SkipProcessedFiles)
|
|
||||||
fmt.Println("Config:", config)
|
|
||||||
|
|
||||||
if err := h.DB.Create(&config).Error; err != nil {
|
if err := h.DB.Create(&config).Error; err != nil {
|
||||||
log.Printf("Error creating config: %v", err)
|
log.Printf("Error creating config: %v", err)
|
||||||
c.String(http.StatusInternalServerError, fmt.Sprintf("Failed to create config: %v", err))
|
c.String(http.StatusInternalServerError, fmt.Sprintf("Failed to create config: %v", err))
|
||||||
|
|||||||
Reference in New Issue
Block a user