From c30b652f4b210204bf8093372fa0cae2f0cb3075 Mon Sep 17 00:00:00 2001 From: darmiel <71837281+darmiel@users.noreply.github.com> Date: Fri, 3 Nov 2023 15:43:36 +0100 Subject: [PATCH] fix[backend]: missing middleware for action/topic handlers --- backend/api/handlers/action_handler.go | 3 --- backend/api/routes/action_routes.go | 4 +--- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/backend/api/handlers/action_handler.go b/backend/api/handlers/action_handler.go index e757cdd..4528a65 100644 --- a/backend/api/handlers/action_handler.go +++ b/backend/api/handlers/action_handler.go @@ -2,7 +2,6 @@ package handlers import ( "database/sql" - "errors" "fmt" "github.com/darmiel/perplex/api/presenter" "github.com/darmiel/perplex/api/services" @@ -14,8 +13,6 @@ import ( "time" ) -var ErrNotImplemented = errors.New("not implemented yet") - type ActionHandler struct { srv services.ActionService topicSrv services.TopicService diff --git a/backend/api/routes/action_routes.go b/backend/api/routes/action_routes.go index 42d0856..c353ae5 100644 --- a/backend/api/routes/action_routes.go +++ b/backend/api/routes/action_routes.go @@ -10,6 +10,7 @@ func ActionRoutes(router fiber.Router, handler *handlers.ActionHandler, middlewa router.Post("/", handler.CreateAction) router.Get("/me", handler.ListActionsForProjectAndUser) + // list for topic router.Use("/topic/:topic_id", handler.TopicLocalsMiddleware) router.Get("/topic/:topic_id", handler.ListActionsForTopic) @@ -27,9 +28,6 @@ func ActionRoutes(router fiber.Router, handler *handlers.ActionHandler, middlewa // specific topic specificTopic := specific.Group("/topic/:topic_id") - specificTopic.Post("/", handler.LinkTopic) - specificTopic.Delete("/", handler.UnlinkTopic) - specificTopic.Use(handler.TopicLocalsMiddleware) specificTopic.Post("/", handler.LinkTopic) specificTopic.Delete("/", handler.UnlinkTopic)