aboutsummaryrefslogtreecommitdiff
path: root/src/guff/api/post.cr
diff options
context:
space:
mode:
Diffstat (limited to 'src/guff/api/post.cr')
-rw-r--r--src/guff/api/post.cr18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/guff/api/post.cr b/src/guff/api/post.cr
index 499e7c0..f856d5b 100644
--- a/src/guff/api/post.cr
+++ b/src/guff/api/post.cr
@@ -4,12 +4,15 @@ module Guff
module API
module PostAPI
GET_POSTS_FILTERS = {
- q: "q",
- year: "year",
- month: "month",
- day: "day",
- slug: "slug",
- state: "state",
+ q: "q",
+ posted_year: "posted_year",
+ posted_month: "posted_month",
+ posted_day: "posted_day",
+ created_year: "created_year",
+ created_month: "created_month",
+ created_day: "created_day",
+ slug: "slug",
+ state: "state",
}
private def do_post_get_posts(
@@ -26,8 +29,9 @@ module Guff
@models.post.get_posts(
site_id: get_site(context),
filters: filters,
- tags: get_posts_tags(args["tags"]),
+ tags: get_posts_tags(args["tags"]?),
page: args.has_key?("page") ? args["page"].to_i : 1,
+ sort: get_posts_sort(args["sort"]?),
)
end