0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-04-04 01:24:56 +02:00

fix group team unit query

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2025-11-30 19:31:02 -05:00
parent aae627e4e8
commit 6f76360208
No known key found for this signature in database
GPG Key ID: 924A5F6AF051E87C
2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ type RepoGroupTeam struct {
func (g *RepoGroupTeam) LoadGroupUnits(ctx context.Context) error {
var err error
g.Units, err = GetUnitsByGroupID(ctx, g.GroupID)
g.Units, err = GetUnitsByGroupID(ctx, g.GroupID, g.TeamID)
return err
}

View File

@ -24,8 +24,8 @@ func (g *RepoGroupUnit) Unit() unit.Unit {
return unit.Units[g.Type]
}
func GetUnitsByGroupID(ctx context.Context, groupID int64) (units []*RepoGroupUnit, err error) {
return units, db.GetEngine(ctx).Where("group_id = ?", groupID).Find(&units)
func GetUnitsByGroupID(ctx context.Context, groupID, teamID int64) (units []*RepoGroupUnit, err error) {
return units, db.GetEngine(ctx).Where("group_id = ?", groupID).And("team_id = ?", teamID).Find(&units)
}
func GetGroupUnit(ctx context.Context, groupID, teamID int64, unitType unit.Type) (unit *RepoGroupUnit, err error) {