fix: 后端添加博客列表遗漏的描述字段
This commit is contained in:
@@ -13,7 +13,7 @@ export class BlogService {
|
|||||||
private readonly blogRepository: Repository<Blog>,
|
private readonly blogRepository: Repository<Blog>,
|
||||||
@InjectRepository(BlogComment)
|
@InjectRepository(BlogComment)
|
||||||
private readonly blogCommentRepository: Repository<BlogComment>,
|
private readonly blogCommentRepository: Repository<BlogComment>,
|
||||||
) {}
|
) { }
|
||||||
|
|
||||||
async list(
|
async list(
|
||||||
option: {
|
option: {
|
||||||
@@ -35,13 +35,14 @@ export class BlogService {
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { createdAt, deletedAt, id, title, viewCount } = i;
|
const { createdAt, deletedAt, id, title, viewCount, description } = i;
|
||||||
return {
|
return {
|
||||||
createdAt,
|
createdAt,
|
||||||
deletedAt,
|
deletedAt,
|
||||||
id,
|
id,
|
||||||
title,
|
title,
|
||||||
viewCount,
|
viewCount,
|
||||||
|
description,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -111,10 +112,10 @@ export class BlogService {
|
|||||||
...rest,
|
...rest,
|
||||||
user: user
|
user: user
|
||||||
? {
|
? {
|
||||||
userId: user.userId,
|
userId: user.userId,
|
||||||
username: user.username,
|
username: user.username,
|
||||||
nickname: user.nickname,
|
nickname: user.nickname,
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -129,10 +130,10 @@ export class BlogService {
|
|||||||
...commentWithoutBlog,
|
...commentWithoutBlog,
|
||||||
user: user
|
user: user
|
||||||
? {
|
? {
|
||||||
userId: user.userId,
|
userId: user.userId,
|
||||||
username: user.username,
|
username: user.username,
|
||||||
nickname: user.nickname,
|
nickname: user.nickname,
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user