use context
This commit is contained in:
@@ -101,8 +101,8 @@ func TUIQuestion(interfaceType task.InterfaceType, fields ...huh.Field) *huh.Gro
|
|||||||
|
|
||||||
// FetchIssues retrives all issues from the app and returns those that are relevant for validation,
|
// FetchIssues retrives all issues from the app and returns those that are relevant for validation,
|
||||||
// excluding the setup issue. It also updates the setup issue with the latest data from the app.
|
// excluding the setup issue. It also updates the setup issue with the latest data from the app.
|
||||||
func FetchIssues(app *service.App, setupIssue *models.Issue) ([]*models.Issue, error) {
|
func FetchIssues(ctx context.Context, app *service.App, setupIssue *models.Issue) ([]*models.Issue, error) {
|
||||||
issues, err := app.Issues.SearchIssues(context.Background(), "", models.IssueFilter{})
|
issues, err := app.Issues.SearchIssues(ctx, "", models.IssueFilter{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ func (t *CreateIssueTask) Setup(ctx context.Context) error {
|
|||||||
func (t *CreateIssueTask) Validate(ctx context.Context) ValidationFeedback {
|
func (t *CreateIssueTask) Validate(ctx context.Context) ValidationFeedback {
|
||||||
expect := utils.NewExpector()
|
expect := utils.NewExpector()
|
||||||
|
|
||||||
issues, err := FetchIssues(t.app, t.setupIssue)
|
issues, err := FetchIssues(ctx, t.app, t.setupIssue)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return expect.ValidationFeedback
|
return expect.ValidationFeedback
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user