mirror of
https://github.com/SunnyQjm/sunny-blog-server.git
synced 2026-10-04 19:52:21 +08:00
add: 添加更新博文接口
This commit is contained in:
1 parent
d642794be4
commit
7e521ae29c
2 files changed
+6
No files matched your search
@@ -72,6 +72,9 @@ export class AdminController {
|
||||
if (updatePostDto.content) {
|
||||
post.content = updatePostDto.content;
|
||||
}
|
||||
if (updatePostDto.title) {
|
||||
post.title = updatePostDto.title;
|
||||
}
|
||||
await this.postService.savePost(post);
|
||||
return ResponseUtil.success();
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ export class UpdatePostDto {
|
||||
@IsNumber()
|
||||
id: number;
|
||||
|
||||
@IsString()
|
||||
title: string;
|
||||
|
||||
@IsString()
|
||||
content?: string;
|
||||
|
||||
|
||||
Reference in new issue
Block a user