mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix: address verified review findings (labels-milestones-time-1)
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
21 files changed
+262
-47
No files matched your search
@@ -385,8 +385,13 @@ func (a *application) completeLabels() cobra.CompletionFunc {
|
||||
|
||||
// completeMilestones completes the titles of open milestones.
|
||||
func (a *application) completeMilestones() cobra.CompletionFunc {
|
||||
return a.completeMilestonesIn("open")
|
||||
}
|
||||
|
||||
// completeMilestonesIn completes the titles of the milestones in state: open, closed or all.
|
||||
func (a *application) completeMilestonesIn(state string) cobra.CompletionFunc {
|
||||
return a.apiCompletion(true, func(ctx context.Context, t target, _ string) ([]cobra.Completion, error) {
|
||||
items, err := services.Milestones{Client: t.client, Repository: t.Repo}.List(ctx, "open", completionLimit, 1)
|
||||
items, err := services.Milestones{Client: t.client, Repository: t.Repo}.List(ctx, state, completionLimit, 1)
|
||||
return describe(items, func(item services.Milestone) (string, string) { return item.Title, item.Description }), err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user