Dan Anglin
43095b9932
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.
27 lines
514 B
Go
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
|
|
}
|