feat: trim white space

This commit is contained in:
Simon Ding
2024-09-23 22:44:15 +08:00
parent 40c6e2df5c
commit f4ccc69b50
5 changed files with 48 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ package server
import (
"polaris/ent"
"polaris/pkg/utils"
"strconv"
"github.com/gin-gonic/gin"
@@ -35,6 +36,7 @@ func (s *Server) AddNotificationClient(c *gin.Context) (interface{}, error) {
if err := c.ShouldBindJSON(&in); err != nil {
return nil, errors.Wrap(err, "json")
}
utils.TrimFields(&in)
err := s.db.AddNotificationClient(in.Name, in.Service, in.Settings, in.Enabled)
if err != nil {