adding assignee for tui

This commit is contained in:
viljarb
2026-03-11 21:23:07 +01:00
parent 7ceb0929c5
commit 0b4e33b28f
15 changed files with 184 additions and 16 deletions

View File

@@ -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 {