feat: update handlers in posts
All checks were successful
Backend ci / build (push) Successful in 3m29s

This commit is contained in:
d3m0k1d
2026-02-13 14:46:44 +03:00
parent 15cf6cca8a
commit 2c198e56eb
4 changed files with 69 additions and 5 deletions

View File

@@ -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())
}
}