Skip to content
Snippets Groups Projects
Commit 44f089f9 authored by Etienne LOUPIAS's avatar Etienne LOUPIAS
Browse files

fix: no display if empty post

parent 548ca4c7
No related branches found
No related tags found
2 merge requests!244Dev,!243feat/US17-posts-pagination
......@@ -117,7 +117,7 @@ export class PostListComponent implements OnInit {
// Transform excerpt post to have a custom author.
private addAuthorToPost(post: Post): Post {
post.author = post.excerpt;
post.excerpt = post.html.replace(/<[^>]*>/g, '');
if (post.html) post.excerpt = post.html.replace(/<[^>]*>/g, '');
return post;
}
......
......
......@@ -53,7 +53,7 @@ export class PostService {
private addAuthorToPost(post: Post): Post {
post.author = post.excerpt;
post.excerpt = post.html.replace(/<[^>]*>/g, '');
if (post.html) post.excerpt = post.html.replace(/<[^>]*>/g, '');
return post;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment