Implement HTTP REST CRUD API

This commit is contained in:
2026-02-02 21:17:03 +02:00
parent b309ccd9cd
commit d3f29e3927
4 changed files with 316 additions and 0 deletions

View File

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