2024-01-09 15:51:23 +00:00
|
|
|
package ui
|
|
|
|
|
2024-01-13 19:54:24 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"codeflow.dananglin.me.uk/apollo/pelican/internal/board"
|
|
|
|
)
|
2024-01-09 15:51:23 +00:00
|
|
|
|
|
|
|
type statusSelection struct {
|
|
|
|
cardID int
|
|
|
|
currentStatusID int
|
|
|
|
nextStatusID int
|
|
|
|
}
|
|
|
|
|
2024-01-13 19:54:24 +00:00
|
|
|
func (s statusSelection) moveCard(kanban board.Board) error {
|
2024-01-09 15:51:23 +00:00
|
|
|
moveArgs := board.MoveToStatusArgs{
|
|
|
|
CardID: s.cardID,
|
|
|
|
CurrentStatusID: s.currentStatusID,
|
|
|
|
NextStatusID: s.nextStatusID,
|
|
|
|
}
|
|
|
|
|
2024-01-13 19:54:24 +00:00
|
|
|
if err := kanban.MoveToStatus(moveArgs); err != nil {
|
|
|
|
return fmt.Errorf("error moving card; %w", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
2024-01-09 15:51:23 +00:00
|
|
|
}
|