Skip to content

Commit

Permalink
fix[backend]: missing middleware for action/topic handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
darmiel committed Nov 3, 2023
1 parent 8a75b4b commit c30b652
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
3 changes: 0 additions & 3 deletions backend/api/handlers/action_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package handlers

import (
"database/sql"
"errors"
"fmt"
"github.com/darmiel/perplex/api/presenter"
"github.com/darmiel/perplex/api/services"
Expand All @@ -14,8 +13,6 @@ import (
"time"
)

var ErrNotImplemented = errors.New("not implemented yet")

type ActionHandler struct {
srv services.ActionService
topicSrv services.TopicService
Expand Down
4 changes: 1 addition & 3 deletions backend/api/routes/action_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
Expand Down

0 comments on commit c30b652

Please sign in to comment.