diff --git a/backend/service/addRoute.go b/backend/service/addRoute.go index 3697e46..79877fd 100644 --- a/backend/service/addRoute.go +++ b/backend/service/addRoute.go @@ -194,6 +194,24 @@ func AddRoutes(app *pocketbase.PocketBase) { return nil }) + app.OnBeforeServe().Add(func(e *core.ServeEvent) error { + _, err := e.Router.AddRoute(echo.Route{ + Method: http.MethodPut, + Path: "/api/feed", + Handler: func(c echo.Context) error { + token := c.QueryParam("token") + return c.JSON(http.StatusOK, "token: "+token) + }, + Middlewares: []echo.MiddlewareFunc{ + apis.ActivityLogger(app), + }, + }) + if err != nil { + return err + } + return nil + }) + app.OnBeforeServe().Add(func(e *core.ServeEvent) error { _, err := e.Router.AddRoute(echo.Route{ Method: http.MethodGet, diff --git a/backend/service/ical/icalFileGeneration.go b/backend/service/ical/icalFileGeneration.go index 2b92f10..09019ba 100644 --- a/backend/service/ical/icalFileGeneration.go +++ b/backend/service/ical/icalFileGeneration.go @@ -99,7 +99,9 @@ func (icalModel IcalModel) daylight(tz *goics.Component) { // if reminder is specified in the configuration for this event, an alarm will be added to the event func addAlarmIfSpecified(s *goics.Component, event model.Event, mapping model.FeedCollection) { - if mapping.Reminder { + // if event.Start > now + // then add alarm + if event.Start.Time().Local().After(time.Now().Local()) && mapping.Reminder { a := goics.NewComponent() a.SetType("VALARM") a.AddProperty("TRIGGER", "-P0DT0H15M0S")