pelican/internal/ui/statusselection.go
Dan Anglin 43095b9932
fix(ui): display status message when moving card
After moving cards from one status to another the status bar now shows
either a confirmation or an error message depending on the success of
the move.
2024-01-13 19:54:24 +00:00

27 lines
514 B
Go

package ui
import (
"fmt"
"codeflow.dananglin.me.uk/apollo/pelican/internal/board"
)
type statusSelection struct {
cardID int
currentStatusID int
nextStatusID int
}
func (s statusSelection) moveCard(kanban board.Board) error {
moveArgs := board.MoveToStatusArgs{
CardID: s.cardID,
CurrentStatusID: s.currentStatusID,
NextStatusID: s.nextStatusID,
}
if err := kanban.MoveToStatus(moveArgs); err != nil {
return fmt.Errorf("error moving card; %w", err)
}
return nil
}