mirror of
https://gitea.com/gitea/tea.git
synced 2026-06-25 22:27:39 +02:00
fix(labels): add org label for ls and pr (#1017)
Fix https://gitea.com/gitea/tea/issues/634, https://gitea.com/gitea/tea/issues/669 Reviewed-on: https://gitea.com/gitea/tea/pulls/1017 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Minjie Fang <wingsallen@gmail.com> Co-committed-by: Minjie Fang <wingsallen@gmail.com>
This commit is contained in:
@@ -23,6 +23,16 @@ func ResolveLabelNames(requestCtx stdctx.Context, client *gitea.Client, owner, r
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if _, _, err := client.Organizations.GetOrg(requestCtx, owner); err == nil {
|
||||
orgLabels, _, err := client.Organizations.ListOrgLabels(requestCtx, owner, gitea.ListOrgLabelsOptions{
|
||||
ListOptions: gitea.ListOptions{Page: page, PageSize: 50},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
labels = append(labels, orgLabels...)
|
||||
}
|
||||
|
||||
for _, l := range labels {
|
||||
if utils.Contains(labelNames, l.Name) {
|
||||
labelIDs = append(labelIDs, l.ID)
|
||||
|
||||
Reference in New Issue
Block a user