aboutsummaryrefslogtreecommitdiff
path: root/src/guff/api/methods.cr
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-03-09 15:49:25 -0500
committerPaul Duncan <pabs@pablotron.org>2016-03-09 15:49:25 -0500
commit9f8c1fce2c94c9fb040586740e28b3e83a3cc41f (patch)
tree0ad3b470b84c13187ff374c8f2a4d26383095c85 /src/guff/api/methods.cr
parent7417966101a0b0bbd0fefc8723482ae5a2010f19 (diff)
downloadold-guff-9f8c1fce2c94c9fb040586740e28b3e83a3cc41f.tar.bz2
old-guff-9f8c1fce2c94c9fb040586740e28b3e83a3cc41f.zip
add created_at sorting and use json for sort fields
Diffstat (limited to 'src/guff/api/methods.cr')
-rw-r--r--src/guff/api/methods.cr33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/guff/api/methods.cr b/src/guff/api/methods.cr
index 6c38eb3..9b35596 100644
--- a/src/guff/api/methods.cr
+++ b/src/guff/api/methods.cr
@@ -15,20 +15,38 @@ module Guff
required: false,
},
- "year": {
- text: "Year filter",
+ "posted_year": {
+ text: "Post date year filter",
type: :int,
required: false,
},
- "month": {
- text: "Month filter",
+ "posted_month": {
+ text: "Post date month filter",
type: :int,
required: false,
},
- "day": {
- text: "Day filter",
+ "posted_day": {
+ text: "Post date day filter",
+ type: :int,
+ required: false,
+ },
+
+ "created_year": {
+ text: "Creation date year filter",
+ type: :int,
+ required: false,
+ },
+
+ "created_month": {
+ text: "Creation date month filter",
+ type: :int,
+ required: false,
+ },
+
+ "created_day": {
+ text: "Creation date day filter",
type: :int,
required: false,
},
@@ -48,7 +66,7 @@ module Guff
"sort": {
text: "Sort order of results",
- type: :sort,
+ type: :json,
required: false,
},
@@ -340,7 +358,6 @@ module Guff
slug: /^[a-z0-9\.-]+$/,
int: /^\d+$/,
int_list: /^\d+(?:,\d+)*$/,
- sort: /^[a-z0-9_]+,(?:asc|desc)$/,
state: /^(?:draft|posted|deleted)$/,
# FIXME: lock these down more