Skip to content

Commit

Permalink
Merge pull request #109 from homenoc/develop
Browse files Browse the repository at this point in the history
v4.1.2
  • Loading branch information
yoneyan authored Jul 23, 2021
2 parents 8cf9f51 + ebca509 commit 91b42fa
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions pkg/api/core/notice/v0/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,24 @@ func AddByAdmin(c *gin.Context) {
}

var userIDArray []uint
var userArray []core.User

for _, tmpID := range userExtraction(input.UserID, input.GroupID, input.NOCID) {
userIDArray = append(userIDArray, tmpID)
}
if !*input.Everyone {
for _, tmpID := range userExtraction(input.UserID, input.GroupID, input.NOCID) {
userIDArray = append(userIDArray, tmpID)
}

resultUser := dbUser.GetArray(userIDArray)
if resultUser.Err != nil {
log.Println(resultUser.Err.Error())
c.JSON(http.StatusInternalServerError, common.Error{Error: resultUser.Err.Error()})
return
resultUser := dbUser.GetArray(userIDArray)
if resultUser.Err != nil {
log.Println(resultUser.Err.Error())
c.JSON(http.StatusInternalServerError, common.Error{Error: resultUser.Err.Error()})
return
}
userArray = resultUser.User
}

if _, err = dbNotice.Create(&core.Notice{
User: resultUser.User,
User: userArray,
Everyone: input.Everyone,
StartTime: startTime,
EndTime: endTime,
Expand Down

0 comments on commit 91b42fa

Please sign in to comment.