This commit is contained in:
SwiftyOS
2024-09-12 15:50:49 +02:00
parent 9b58faeeb6
commit 9389a30298
2 changed files with 4 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ import (
"github.com/swiftyos/market/utils"
)
func ListAgents(db *pgxpool.Pool) gin.HandlerFunc {
func GetAgents(db *pgxpool.Pool) gin.HandlerFunc {
return func(c *gin.Context) {
logger := zap.L().With(zap.String("function", "ListAgents"))
// Get pagination parameters from context
@@ -247,7 +247,7 @@ func GetFeaturedAgents(db *pgxpool.Pool) gin.HandlerFunc {
}
}
func Search(db *pgxpool.Pool) gin.HandlerFunc {
func SearchAgents(db *pgxpool.Pool) gin.HandlerFunc {
return func(c *gin.Context) {
logger := zap.L().With(zap.String("function", "Search"))
logger.Info("Handling search request")

View File

@@ -42,13 +42,13 @@ func main() {
{
agents := api.Group("/agents")
{
agents.GET("", handlers.ListAgents(db))
agents.GET("", handlers.GetAgents(db))
agents.GET("/:agent_id", handlers.GetAgentDetails(db))
agents.GET("/:agent_id/download", handlers.DownloadAgent(db))
agents.GET("/:agent_id/download-file", handlers.DownloadAgentFile(db))
agents.GET("/top-downloads", handlers.TopAgentsByDownloads(db))
agents.GET("/featured", handlers.GetFeaturedAgents(db))
agents.GET("/search", handlers.Search(db))
agents.GET("/search", handlers.SearchAgents(db))
agents.POST("/submit", middleware.Auth(cfg), handlers.SubmitAgent(db))
}