new set id to 0 to create new uniq id by gorm

This commit is contained in:
Adrian Zürcher
2025-11-06 15:22:23 +01:00
parent 103a07b7ac
commit 8b8d99e162
2 changed files with 10 additions and 12 deletions

View File

@@ -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{