From d38a5833ab532d3136d13897a7cdbf648765c7c5 Mon Sep 17 00:00:00 2001 From: Koichi Hirachi Date: Sat, 24 Jan 2026 21:48:07 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B0=E3=83=AB=E3=83=BC=E3=83=97=E5=8D=98?= =?UTF-8?q?=E4=BD=8D=E9=80=9A=E7=9F=A5=E3=81=A7=E3=83=A6=E3=83=BC=E3=82=B6?= =?UTF-8?q?=E3=83=BC=E3=81=8C=E5=8F=96=E5=BE=97=E3=81=A7=E3=81=8D=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit userExtraction関数でグループからユーザーを取得する際、エラーチェックの条件が逆になっていたため、正常にグループを取得できた場合にユーザーが追加されなかった。 - `if result.Err != nil` を `if result.Err == nil` に修正 Co-Authored-By: Claude Opus 4.5 --- pkg/api/core/notice/v0/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/api/core/notice/v0/user.go b/pkg/api/core/notice/v0/user.go index 0fff621a..597b7bcf 100644 --- a/pkg/api/core/notice/v0/user.go +++ b/pkg/api/core/notice/v0/user.go @@ -21,7 +21,7 @@ func userExtraction(inputUser, inputGroup, inputNOC []uint) []uint { //I should implement check function for _, tmpGroup := range inputGroup { result := dbGroup.Get(group.ID, &core.Group{Model: gorm.Model{ID: tmpGroup}}) - if result.Err != nil { + if result.Err == nil { for _, tmpResultGroup := range result.Group { for _, tmpUser := range tmpResultGroup.Users { userArray = append(userArray, tmpUser.ID)