aboutsummaryrefslogtreecommitdiffstats
path: root/api/handlers/schedule.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/handlers/schedule.go')
-rw-r--r--api/handlers/schedule.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/api/handlers/schedule.go b/api/handlers/schedule.go
index 46589ab..061e6f9 100644
--- a/api/handlers/schedule.go
+++ b/api/handlers/schedule.go
@@ -1,25 +1,26 @@
package handlers
import (
+ "net/http"
+
"github.com/LMBishop/confplanner/api/dto"
"github.com/LMBishop/confplanner/pkg/schedule"
- "github.com/gofiber/fiber/v2"
"github.com/golang-cz/nilslice"
)
-func GetSchedule(service schedule.Service) fiber.Handler {
- return func(c *fiber.Ctx) error {
+func GetSchedule(service schedule.Service) http.HandlerFunc {
+ return dto.WrapResponseFunc(func(w http.ResponseWriter, r *http.Request) error {
schedule, lastUpdated, err := service.GetSchedule()
if err != nil {
return err
}
return &dto.OkResponse{
- Code: fiber.StatusOK,
+ Code: http.StatusOK,
Data: &dto.GetScheduleResponse{
Schedule: nilslice.Initialize(*schedule),
LastUpdated: lastUpdated,
},
}
- }
+ })
}