new set id to 0 to create new uniq id by gorm
This commit is contained in:
@@ -24,14 +24,13 @@ func (a *APIHandler) AddNewResponsible(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
for _, responsible := range responsibles {
|
||||
err = a.DbHandler.AddNewResponsible(responsible)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{
|
||||
"message": err.Error(),
|
||||
})
|
||||
return
|
||||
}
|
||||
err = a.DbHandler.AddNewResponsible(responsibles...)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{
|
||||
"message": err.Error(),
|
||||
})
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
|
||||
Reference in New Issue
Block a user