fixed multipart form issue

This commit is contained in:
Fran Jurmanović
2021-06-05 00:10:23 +02:00
parent 1406c74e67
commit 636a367d3e
12 changed files with 66 additions and 35 deletions

View File

@@ -24,7 +24,7 @@ func NewTransactionController(as *services.TransactionService, s *gin.RouterGrou
func (wc *TransactionController) New(c *gin.Context) {
body := new(models.NewTransactionBody)
if err := c.ShouldBindJSON(body); err != nil {
if err := c.ShouldBind(body); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}