Isrolling fixes and add tests

This commit is contained in:
johan-autohome 2025-01-03 19:11:50 +01:00
parent 11f1985831
commit 015aeba0c2
3 changed files with 97 additions and 15 deletions

View file

@ -195,14 +195,17 @@ func (h *Handler) createChore(c *gin.Context) {
}
circleUsers, err := h.circleRepo.GetCircleUsers(c, currentUser.CircleID)
if err != nil {
log.Print(err)
c.JSON(500, gin.H{"error": "Error getting circle users"})
return
}
for _, assignee := range choreReq.Assignees {
userFound := false
for _, circleUser := range circleUsers {
if assignee.UserID == circleUser.UserID {
userFound = true
break
}
}
if !userFound {