Implement CRUD operations for blog posts with Create, Edit, and Delete handlers
All checks were successful
CI - Build and Push / Build and Push Docker Image (push) Successful in 52s
All checks were successful
CI - Build and Push / Build and Push Docker Image (push) Successful in 52s
This commit is contained in:
@@ -24,6 +24,33 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
rest.WithPrefix("/api/blog"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
rest.WithMiddlewares(
|
||||
[]rest.Middleware{serverCtx.SuperAdminAuthMiddleware},
|
||||
[]rest.Route{
|
||||
{
|
||||
// Create a new blog post
|
||||
Method: http.MethodPost,
|
||||
Path: "/create",
|
||||
Handler: CreatePostHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// Delete a blog post
|
||||
Method: http.MethodPost,
|
||||
Path: "/delete",
|
||||
Handler: DeletePostHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// Edit an existing blog post
|
||||
Method: http.MethodPost,
|
||||
Path: "/edit",
|
||||
Handler: EditPostHandler(serverCtx),
|
||||
},
|
||||
}...,
|
||||
),
|
||||
rest.WithPrefix("/api/blog/post"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
rest.WithMiddlewares(
|
||||
[]rest.Middleware{serverCtx.SuperAdminAuthMiddleware},
|
||||
|
||||
Reference in New Issue
Block a user