diff options
Diffstat (limited to 'src/actions.js')
-rw-r--r-- | src/actions.js | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/actions.js b/src/actions.js index 2ad0c77..61f4fd8 100644 --- a/src/actions.js +++ b/src/actions.js @@ -50,17 +50,15 @@ function post(config, responder, posts) { }; } -function taxonGenerator(config, responder, term, items) { +function tag(config, responder, items) { return async function(ctx, next) { - const value = ctx.params.value; - ctx.assert(items.has(ctx.params.value), 404, `${term} ${value} not found`); - - const taxonItems = items.get(value); + const tag = ctx.params.name; + ctx.assert(items.has(tag), 404, `tag ${tag} not found`); responder(ctx, config, { - listType: term, - listName: value, - posts: taxonItems + listType: "tag", + listName: tag, + posts: items.get(tag) }); }; } @@ -79,6 +77,6 @@ module.exports = { posts, highlightTheme, post, - taxonGenerator, + tag, serveFiles }; |