mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-03 10:19:14 +02:00
feat:#97 added post response and remove notification if event start in past
This commit is contained in:
@@ -194,6 +194,24 @@ func AddRoutes(app *pocketbase.PocketBase) {
|
|||||||
return nil
|
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 {
|
app.OnBeforeServe().Add(func(e *core.ServeEvent) error {
|
||||||
_, err := e.Router.AddRoute(echo.Route{
|
_, err := e.Router.AddRoute(echo.Route{
|
||||||
Method: http.MethodGet,
|
Method: http.MethodGet,
|
||||||
|
@@ -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
|
// 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) {
|
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 := goics.NewComponent()
|
||||||
a.SetType("VALARM")
|
a.SetType("VALARM")
|
||||||
a.AddProperty("TRIGGER", "-P0DT0H15M0S")
|
a.AddProperty("TRIGGER", "-P0DT0H15M0S")
|
||||||
|
Reference in New Issue
Block a user