adding assignee for tui
This commit is contained in:
@@ -15,6 +15,7 @@ type (
|
||||
StatusUpdatedMsg struct{ IssueID string; Err error }
|
||||
PriorityUpdatedMsg struct{ IssueID string; Err error }
|
||||
TypeUpdatedMsg struct{ IssueID string; Err error }
|
||||
AssigneeUpdatedMsg struct{ IssueID string; Err error }
|
||||
SelectIssueMsg struct{ IssueID string }
|
||||
CreatedMsg struct{ Issue *models.Issue; Err error }
|
||||
DeletedMsg struct{ IssueID string; Err error; PreviousIndex int }
|
||||
@@ -65,6 +66,15 @@ func UpdateIssueTypeCmd(app *app.App, issueID string, issueType models.IssueType
|
||||
}
|
||||
}
|
||||
|
||||
// UpdateIssueAssigneeCmd returns a command that updates an issue's assignee.
|
||||
func UpdateIssueAssigneeCmd(app *app.App, issueID, assignee string) tea.Cmd {
|
||||
return func() tea.Msg {
|
||||
updates := map[string]interface{}{"assignee": assignee}
|
||||
err := app.Issues.UpdateIssue(context.Background(), issueID, updates, "tui")
|
||||
return AssigneeUpdatedMsg{IssueID: issueID, Err: err}
|
||||
}
|
||||
}
|
||||
|
||||
// CreateIssueCmd returns a command that creates a new issue.
|
||||
func CreateIssueCmd(app *app.App, title string) tea.Cmd {
|
||||
return func() tea.Msg {
|
||||
|
||||
Reference in New Issue
Block a user