New route to delete the next alarm
This commit is contained in:
parent
4e0450faca
commit
fa13484718
4 changed files with 78 additions and 1 deletions
|
@ -22,6 +22,16 @@ func declareAlarmsRoutes(cfg *config.Config, db *reveil.LevelDBStorage, resetTim
|
|||
c.JSON(http.StatusOK, alarm)
|
||||
})
|
||||
|
||||
router.DELETE("/alarms/next", func(c *gin.Context) {
|
||||
err := reveil.DropNextAlarm(cfg, db)
|
||||
if err != nil {
|
||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, true)
|
||||
})
|
||||
|
||||
router.GET("/alarms/single", func(c *gin.Context) {
|
||||
alarms, err := reveil.GetAlarmsSingle(db)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue