Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix AddCollectionDefaultGroup return Add ID

aichy126d1becf0ffa14
diff --git a/internal/repo/collection/collection_group_repo.go b/internal/repo/collection/collection_group_repo.go
index 405cb6dd..734d4307 100644
--- a/internal/repo/collection/collection_group_repo.go
+++ b/internal/repo/collection/collection_group_repo.go
@@ -40,12 +40,12 @@ func (cr *collectionGroupRepo) AddCollectionDefaultGroup(ctx context.Context, us
DefaultGroup: schema.CG_DEFAULT,
UserID: userID,
}
-
_, err = cr.data.DB.Insert(defaultGroup)
if err != nil {
err = errors.InternalServer(reason.DatabaseError).WithError(err).WithStack()
return
}
+ collectionGroup = defaultGroup
return
}