feat: 创建博客支持slug字段了

This commit is contained in:
2025-12-27 13:05:07 +08:00
parent a2e8ddebca
commit 58b7f592fe
4 changed files with 71 additions and 3 deletions

View File

@@ -57,6 +57,9 @@ export class BlogService {
.digest('hex');
}
}
if (typeof blog.slug === 'string' && blog.slug.trim().length === 0) {
blog.slug = null;
}
const newBlog = this.blogRepository.create(blog);
return this.blogRepository.save(newBlog);