Skip to content

Commit

Permalink
fix: the problem of encrypted category displayed in query posts accor…
Browse files Browse the repository at this point in the history
…ding to category (#1811)
  • Loading branch information
guqing authored Apr 2, 2022
1 parent 438b977 commit 36abdba
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package run.halo.app.core.freemarker.tag;

import com.google.common.collect.Sets;
import freemarker.core.Environment;
import freemarker.template.Configuration;
import freemarker.template.DefaultObjectWrapperBuilder;
Expand Down Expand Up @@ -84,15 +83,12 @@ public void execute(Environment env, Map params, TemplateModel[] loopVars,
Integer categoryId = Integer.parseInt(params.get("categoryId").toString());
env.setVariable("posts", builder.build()
.wrap(postRenderAssembler.convertToListVo(
postCategoryService.listPostBy(categoryId,
Sets.immutableEnumSet(PostStatus.PUBLISHED,
PostStatus.INTIMATE)))));
postCategoryService.listPostBy(categoryId, PostStatus.PUBLISHED))));
break;
case "listByCategorySlug":
String categorySlug = params.get("categorySlug").toString();
List<Post> posts =
postCategoryService.listPostBy(categorySlug,
Sets.immutableEnumSet(PostStatus.PUBLISHED, PostStatus.INTIMATE));
postCategoryService.listPostBy(categorySlug, PostStatus.PUBLISHED);
env.setVariable("posts",
builder.build().wrap(postRenderAssembler.convertToListVo(posts)));
break;
Expand Down

0 comments on commit 36abdba

Please sign in to comment.