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:
StarFleetCPTN
2025-03-14 23:23:41 -07:00
parent f11c03e22e
commit a954023800
-6
View File
@@ -72,16 +72,10 @@ func (h *Handlers) HandleCreateConfig(c *gin.Context) {
userID := c.GetUint("userID")
config.CreatedBy = userID
// print entire form data
fmt.Println("Form data:", c.Request.Form)
// Process skipProcessedFiles value (now using pointer)
skipProcessedValue := c.Request.FormValue("skip_processed_files") == "true"
config.SkipProcessedFiles = &skipProcessedValue
fmt.Println("Skip processed files:", config.SkipProcessedFiles)
fmt.Println("Config:", config)
if err := h.DB.Create(&config).Error; err != nil {
log.Printf("Error creating config: %v", err)
c.String(http.StatusInternalServerError, fmt.Sprintf("Failed to create config: %v", err))