@@ -139,18 +139,23 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
if flagDescription != "" {
|
||||
input["description"] = flagDescription
|
||||
}
|
||||
|
||||
if flagPriority != "" {
|
||||
input["priority"] = flagPriority
|
||||
}
|
||||
|
||||
if flagMeasure != "" {
|
||||
input["measureId"] = flagMeasure
|
||||
}
|
||||
|
||||
if flagTimeEstimate != "" {
|
||||
input["timeEstimate"] = flagTimeEstimate
|
||||
}
|
||||
|
||||
if flagAssignedTo != "" {
|
||||
input["assignedToId"] = flagAssignedTo
|
||||
}
|
||||
|
||||
if flagDeadline != "" {
|
||||
input["deadline"] = flagDeadline
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
|
||||
}
|
||||
|
||||
var confirmed bool
|
||||
|
||||
err := huh.NewConfirm().
|
||||
Title(fmt.Sprintf("Delete task %s?", args[0])).
|
||||
Value(&confirmed).
|
||||
@@ -52,6 +53,7 @@ func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !confirmed {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||
if err := cmdutil.ValidateEnum("order-by", flagOrderBy, []string{"PRIORITY_RANK", "CREATED_AT"}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
variables["orderBy"] = map[string]any{
|
||||
"field": flagOrderBy,
|
||||
"direction": flagOrderDir,
|
||||
@@ -136,12 +137,15 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||
if err := json.Unmarshal(data, &resp); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if resp.Node == nil {
|
||||
return nil, fmt.Errorf("organization %s not found", flagOrg)
|
||||
}
|
||||
|
||||
if resp.Node.Typename != "Organization" {
|
||||
return nil, fmt.Errorf("expected Organization node, got %s", resp.Node.Typename)
|
||||
}
|
||||
|
||||
return &resp.Node.Tasks, nil
|
||||
},
|
||||
)
|
||||
@@ -164,6 +168,7 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||
if t.Deadline != nil {
|
||||
deadline = *t.Deadline
|
||||
}
|
||||
|
||||
rows = append(rows, []string{
|
||||
t.ID,
|
||||
t.Name,
|
||||
|
||||
@@ -89,21 +89,27 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
|
||||
if cmd.Flags().Changed("name") {
|
||||
input["name"] = flagName
|
||||
}
|
||||
|
||||
if cmd.Flags().Changed("description") {
|
||||
input["description"] = flagDescription
|
||||
}
|
||||
|
||||
if cmd.Flags().Changed("state") {
|
||||
input["state"] = flagState
|
||||
}
|
||||
|
||||
if cmd.Flags().Changed("priority") {
|
||||
input["priority"] = flagPriority
|
||||
}
|
||||
|
||||
if cmd.Flags().Changed("time-estimate") {
|
||||
input["timeEstimate"] = flagTimeEstimate
|
||||
}
|
||||
|
||||
if cmd.Flags().Changed("deadline") {
|
||||
input["deadline"] = flagDeadline
|
||||
}
|
||||
|
||||
if cmd.Flags().Changed("assigned-to") {
|
||||
if flagAssignedTo == "" {
|
||||
input["assignedToId"] = nil
|
||||
@@ -111,6 +117,7 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
|
||||
input["assignedToId"] = flagAssignedTo
|
||||
}
|
||||
}
|
||||
|
||||
if cmd.Flags().Changed("measure") {
|
||||
if flagMeasure == "" {
|
||||
input["measureId"] = nil
|
||||
|
||||
Reference in New Issue
Block a user