From ba0c7caabb441ad71d7a633ea05a3c38584eb008 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Sat, 16 Aug 2025 16:20:46 -0400 Subject: [PATCH] add `AvatarURL` field to api groups (in `modules/structs` package) --- modules/structs/repo_group.go | 1 + services/convert/repo_group.go | 1 + templates/swagger/v1_json.tmpl | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/modules/structs/repo_group.go b/modules/structs/repo_group.go index ce37bb3980..3e0f8fdbc0 100644 --- a/modules/structs/repo_group.go +++ b/modules/structs/repo_group.go @@ -14,6 +14,7 @@ type Group struct { NumSubgroups int64 `json:"num_subgroups"` Link string `json:"link"` SortOrder int `json:"sort_order"` + AvatarURL string `json:"avatar_url"` } // NewGroupOption represents options for creating a new group in an organization diff --git a/services/convert/repo_group.go b/services/convert/repo_group.go index 82b849318b..25d39ffbec 100644 --- a/services/convert/repo_group.go +++ b/services/convert/repo_group.go @@ -26,6 +26,7 @@ func ToAPIGroup(ctx context.Context, g *group_model.Group, actor *user_model.Use ParentGroupID: g.ParentGroupID, Link: g.GroupLink(), SortOrder: g.SortOrder, + AvatarURL: g.AvatarLink(ctx), } if apiGroup.NumSubgroups, err = group_model.CountGroups(ctx, &group_model.FindGroupsOptions{ ParentGroupID: g.ID, diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 6c4e833b22..719f3d3860 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -26436,6 +26436,10 @@ "description": "Group represents a group of repositories and subgroups in an organization", "type": "object", "properties": { + "avatar_url": { + "type": "string", + "x-go-name": "AvatarURL" + }, "description": { "type": "string", "x-go-name": "Description"