simplifying the code in pkg/cli/commands/delete.go
This commit is contained in:
@@ -4,8 +4,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/LazyBachelor/LazyPM/internal/models"
|
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -22,11 +20,7 @@ var deleteCmd = &cobra.Command{
|
|||||||
func runDeleteCmd(cmd *cobra.Command, args []string) error {
|
func runDeleteCmd(cmd *cobra.Command, args []string) error {
|
||||||
deleteID := strings.Join(args, " ")
|
deleteID := strings.Join(args, " ")
|
||||||
|
|
||||||
issue := &models.Issue{
|
err := svc.Beads.DeleteIssue(cmd.Context(), deleteID)
|
||||||
ID: deleteID,
|
|
||||||
}
|
|
||||||
|
|
||||||
err := svc.Beads.DeleteIssue(cmd.Context(), issue.ID)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error deleting issue: %w", err)
|
return fmt.Errorf("error deleting issue: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user