mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-04 00:06:22 +00:00
✨ feat: 修复创建帖子时参数验证失败的处理逻辑,并更新博客卡片链接路径
This commit is contained in:
@ -29,6 +29,7 @@ func (p *PostController) Create(ctx context.Context, c *app.RequestContext) {
|
|||||||
var req dto.CreateOrUpdatePostReq
|
var req dto.CreateOrUpdatePostReq
|
||||||
if err := c.BindAndValidate(&req); err != nil {
|
if err := c.BindAndValidate(&req); err != nil {
|
||||||
resps.BadRequest(c, resps.ErrParamInvalid)
|
resps.BadRequest(c, resps.ErrParamInvalid)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
postID, err := p.service.CreatePost(ctx, &req)
|
postID, err := p.service.CreatePost(ctx, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -234,7 +234,7 @@ export function BlogCardGrid({
|
|||||||
return (
|
return (
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||||
{filteredPosts.map((post) => (
|
{filteredPosts.map((post) => (
|
||||||
<Link key={post.id} href={`/posts/${post.id}`} className="block h-full">
|
<Link key={post.id} href={`/p/${post.id}`} className="block h-full">
|
||||||
<BlogCard post={post} />
|
<BlogCard post={post} />
|
||||||
</Link>
|
</Link>
|
||||||
))}
|
))}
|
||||||
|
Reference in New Issue
Block a user