aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/web/query-parameters.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix-data-service/web/query-parameters.scm')
-rw-r--r--guix-data-service/web/query-parameters.scm19
1 files changed, 18 insertions, 1 deletions
diff --git a/guix-data-service/web/query-parameters.scm b/guix-data-service/web/query-parameters.scm
index c12a490..6679711 100644
--- a/guix-data-service/web/query-parameters.scm
+++ b/guix-data-service/web/query-parameters.scm
@@ -42,7 +42,11 @@
parse-datetime
parse-checkbox-value
parse-number
- parse-result-limit))
+ parse-result-limit
+ parse-system
+ parse-target
+
+ valid-targets->options))
(define (parse-query-string query)
"Parse and decode the URI query string QUERY and return an alist."
@@ -219,6 +223,19 @@
(define parse-result-limit parse-number)
+(define parse-system identity)
+
+(define (parse-target target)
+ (if (string=? target "none")
+ ""
+ target))
+
+(define (valid-targets->options targets)
+ `(("" . "none")
+ ,@(map (lambda (target)
+ (cons target target))
+ targets)))
+
(define (any-invalid-query-parameters? query-parameters)
(->bool (any (lambda (val)
(if (list? val)