diff options
author | Paul Duncan <pabs@pablotron.org> | 2016-03-06 23:12:06 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2016-03-06 23:12:06 -0500 |
commit | f0f87c439037715cac407004e2220c678d96757a (patch) | |
tree | 40e9330d709f2b33f6e95fa7b87ec6b3990e3c17 /src/guff/api-methods.cr | |
parent | 70e294e312710eb1e89c9cacd09a830e05d4bbe9 (diff) | |
download | old-guff-f0f87c439037715cac407004e2220c678d96757a.tar.bz2 old-guff-f0f87c439037715cac407004e2220c678d96757a.zip |
chaos!
Diffstat (limited to 'src/guff/api-methods.cr')
-rw-r--r-- | src/guff/api-methods.cr | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/guff/api-methods.cr b/src/guff/api-methods.cr index f0df8bc..598f050 100644 --- a/src/guff/api-methods.cr +++ b/src/guff/api-methods.cr @@ -321,7 +321,17 @@ module Guff context : HTTP::Server::Context, args : Hash(String, String) ) - @models.post.get_posts(args).to_json + @models.post.get_posts( + site_id: get_site_id(context.request.headers["host"]?), + q: args["q"]? || "", + page: args["page"]? ? args["page"].to_i : 1, + tags: args["tags"]? ? [args["tags"].split(/,/)] : [] of Array(String), + ).to_json + end + + private def get_site_id(host : String?) + # TODO + 0 end private def do_post_add_post( |