feat: update handlers in posts
All checks were successful
Backend ci / build (push) Successful in 3m29s
All checks were successful
Backend ci / build (push) Successful in 3m29s
This commit is contained in:
@@ -3,6 +3,7 @@ package handlers
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
"gitea.d3m0k1d.ru/d3m0k1d/d3m0k1d.ru/backend/internal/auth"
|
||||
"gitea.d3m0k1d.ru/d3m0k1d/d3m0k1d.ru/backend/internal/repositories"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -16,10 +17,11 @@ func Register(router *gin.Engine, db *sql.DB) {
|
||||
v1.GET("/auth/github", handler_auth.LoginGithub)
|
||||
posts := v1.Group("posts")
|
||||
{
|
||||
|
||||
posts.GET("/", handler_posts.GetPosts)
|
||||
posts.GET("/:id", handler_posts.GetPost)
|
||||
posts.POST("/", handler_posts.CreatePost)
|
||||
posts.PUT("/:id", handler_posts.UpdatePost)
|
||||
posts.DELETE("/:id", DeletePost)
|
||||
posts.DELETE("/:id", handler_posts.DeletePost).Use(auth.JWTMiddleware())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user