aboutsummaryrefslogtreecommitdiff
path: root/src/guff/api/methods.cr
diff options
context:
space:
mode:
Diffstat (limited to 'src/guff/api/methods.cr')
-rw-r--r--src/guff/api/methods.cr32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/guff/api/methods.cr b/src/guff/api/methods.cr
index f3a7f3c..6c38eb3 100644
--- a/src/guff/api/methods.cr
+++ b/src/guff/api/methods.cr
@@ -13,7 +13,6 @@ module Guff
text: "Search string.",
type: :text,
required: false,
- default: "",
},
"year": {
@@ -43,17 +42,14 @@ module Guff
"tags": {
text: "Comma-separated list of tags (union)",
- # type: :tag_list,
type: :json,
required: false,
- default: "",
},
"sort": {
text: "Sort order of results",
type: :sort,
required: false,
- default: "date,desc",
},
"cols": {
@@ -61,6 +57,19 @@ module Guff
type: :text,
required: false,
},
+
+ "slug": {
+ text: "Post slug",
+ type: :text,
+ required: false,
+ },
+
+ "state": {
+ text: "Post state (draft, posted, deleted)",
+ type: :state,
+ required: false,
+ default: "posted",
+ },
},
},
@@ -90,7 +99,13 @@ module Guff
# type: :tag_list,
type: :json,
required: false,
- default: "",
+ },
+
+ "state": {
+ text: "Post state (draft, posted, deleted)",
+ type: :state,
+ required: false,
+ default: "draft",
},
},
},
@@ -122,9 +137,9 @@ module Guff
required: false,
},
- "posted": {
- text: "Is this post posted?",
- type: :bool,
+ "state": {
+ text: "Post state (draft, posted, deleted)",
+ type: :state,
required: false,
},
},
@@ -326,6 +341,7 @@ module Guff
int: /^\d+$/,
int_list: /^\d+(?:,\d+)*$/,
sort: /^[a-z0-9_]+,(?:asc|desc)$/,
+ state: /^(?:draft|posted|deleted)$/,
# FIXME: lock these down more
json: /.*/,