refactor services to use Interface and change name to app

This commit is contained in:
Robin Olsen
2026-02-22 16:16:09 +01:00
parent dbf619a054
commit 118e67dbf4
36 changed files with 247 additions and 219 deletions

View File

@@ -30,8 +30,10 @@ func runCloseCmd(cmd *cobra.Command, args []string) error {
return fmt.Errorf("issue ID cannot be empty")
}
app := AppFromContext(cmd.Context())
// Fetch the issue to ensure it exists before closing.
issue, err := svc.Beads.GetIssue(cmd.Context(), closeID)
issue, err := app.Issues.GetIssue(cmd.Context(), closeID)
if err != nil {
return fmt.Errorf("error fetching issue: %w", err)
}
@@ -47,7 +49,7 @@ func runCloseCmd(cmd *cobra.Command, args []string) error {
}
// Close the issue.
err = svc.Beads.CloseIssue(cmd.Context(), closeID, issue.CloseReason, "", "")
err = app.Issues.CloseIssue(cmd.Context(), closeID, issue.CloseReason, "", "")
if err != nil {
return fmt.Errorf("error closing issue: %w", err)
}