aboutsummaryrefslogtreecommitdiff
path: root/src/guff/api/post.cr
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-03-09 13:38:24 -0500
committerPaul Duncan <pabs@pablotron.org>2016-03-09 13:38:24 -0500
commit7417966101a0b0bbd0fefc8723482ae5a2010f19 (patch)
tree9865c76ee5f40a55a7364c316b7cf1c1bb82485c /src/guff/api/post.cr
parent019667042398a78cf58e6475c81e5c75c4fff895 (diff)
downloadold-guff-7417966101a0b0bbd0fefc8723482ae5a2010f19.tar.bz2
old-guff-7417966101a0b0bbd0fefc8723482ae5a2010f19.zip
add state support
Diffstat (limited to 'src/guff/api/post.cr')
-rw-r--r--src/guff/api/post.cr9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/guff/api/post.cr b/src/guff/api/post.cr
index 55abd86..499e7c0 100644
--- a/src/guff/api/post.cr
+++ b/src/guff/api/post.cr
@@ -8,6 +8,8 @@ module Guff
year: "year",
month: "month",
day: "day",
+ slug: "slug",
+ state: "state",
}
private def do_post_get_posts(
@@ -39,6 +41,7 @@ module Guff
name: args["name"],
body: args["body"],
tags: get_tags(args["tags"]?),
+ state: args["state"]?,
)
# return json
@@ -53,10 +56,10 @@ module Guff
site_id: get_site(context),
post_id: args["post_id"].to_i,
slug: args["slug"]?,
- name: args["name"],
- body: args["body"],
+ name: args["name"]?,
+ body: args["body"]?,
tags: args.has_key?("tags") ? get_tags(args["tags"]?) : nil,
- posted: args.has_key?("posted") ? (args["posted"] == "t") : nil,
+ state: args["state"]?,
)
# return json