Implement HTTP REST CRUD API
This commit is contained in:
@@ -28,6 +28,7 @@ type alarmFiredMsg scheduler.AlarmEvent
|
||||
type alarmsLoadedMsg []db.Alarm
|
||||
type snoozeFireMsg db.Alarm
|
||||
type autoTimeoutMsg struct{}
|
||||
type AlarmsChangedMsg struct{}
|
||||
|
||||
// Model is the main bubbletea model.
|
||||
type Model struct {
|
||||
@@ -149,6 +150,10 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
}
|
||||
return m, nil
|
||||
|
||||
case AlarmsChangedMsg:
|
||||
m.refreshAlarms()
|
||||
return m, nil
|
||||
|
||||
case tickMsg:
|
||||
m.now = time.Time(msg)
|
||||
if m.firingAlarm != nil {
|
||||
|
||||
Reference in New Issue
Block a user