mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 03:27:39 +08:00
feat: trim white space
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"polaris/ent"
|
||||
"polaris/ent/importlist"
|
||||
"polaris/pkg/utils"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/pkg/errors"
|
||||
@@ -28,6 +29,8 @@ func (s *Server) addImportlist(c *gin.Context) (interface{}, error) {
|
||||
if err := c.ShouldBindJSON(&in); err != nil {
|
||||
return nil, errors.Wrap(err, "json")
|
||||
}
|
||||
utils.TrimFields(&in)
|
||||
|
||||
st := s.db.GetStorage(in.StorageId)
|
||||
if st == nil {
|
||||
return nil, fmt.Errorf("storage id not exist: %v", in.StorageId)
|
||||
|
||||
Reference in New Issue
Block a user