A community based topic aggregation platform built on atproto
1package routes
2
3import (
4 "Coves/internal/api/handlers/vote"
5 "Coves/internal/api/middleware"
6 "Coves/internal/core/votes"
7
8 "github.com/go-chi/chi/v5"
9)
10
11// RegisterVoteRoutes registers vote-related XRPC endpoints on the router
12// Implements social.coves.feed.vote.* lexicon endpoints
13func RegisterVoteRoutes(r chi.Router, voteService votes.Service, authMiddleware *middleware.OAuthAuthMiddleware) {
14 // Initialize handlers
15 createHandler := vote.NewCreateVoteHandler(voteService)
16 deleteHandler := vote.NewDeleteVoteHandler(voteService)
17
18 // Procedure endpoints (POST) - require authentication
19 // social.coves.feed.vote.create - create or update a vote on a post/comment
20 r.With(authMiddleware.RequireAuth).Post("/xrpc/social.coves.feed.vote.create", createHandler.HandleCreateVote)
21
22 // social.coves.feed.vote.delete - delete a vote from a post/comment
23 r.With(authMiddleware.RequireAuth).Post("/xrpc/social.coves.feed.vote.delete", deleteHandler.HandleDeleteVote)
24}