feat: 修复创建帖子时参数验证失败的处理逻辑,并更新博客卡片链接路径

This commit is contained in:
2025-07-25 04:32:00 +08:00
parent 1cbfe60f8c
commit a76f03038c
2 changed files with 2 additions and 1 deletions

View File

@ -29,6 +29,7 @@ func (p *PostController) Create(ctx context.Context, c *app.RequestContext) {
var req dto.CreateOrUpdatePostReq
if err := c.BindAndValidate(&req); err != nil {
resps.BadRequest(c, resps.ErrParamInvalid)
return
}
postID, err := p.service.CreatePost(ctx, &req)
if err != nil {

View File

@ -234,7 +234,7 @@ export function BlogCardGrid({
return (
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
{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} />
</Link>
))}