diff options
author | Christopher Baines <mail@cbaines.net> | 2023-05-22 17:25:44 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2023-05-22 17:25:44 +0100 |
commit | 5f21458a8f5319448762fef61f17b7414e7905c7 (patch) | |
tree | 61f3778fb8150078cc38736361bd684940aca2b5 /guix-data-service/web/compare | |
parent | 54c7a1a88006ca2c393fc914755d5cc91ccb466f (diff) | |
download | data-service-5f21458a8f5319448762fef61f17b7414e7905c7.tar data-service-5f21458a8f5319448762fef61f17b7414e7905c7.tar.gz |
Have render-compare/package-derivations provide invalid param info
So that this can be used by the qa-frontpage.
This should be improved and generalised.
Diffstat (limited to 'guix-data-service/web/compare')
-rw-r--r-- | guix-data-service/web/compare/controller.scm | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/guix-data-service/web/compare/controller.scm b/guix-data-service/web/compare/controller.scm index 9aec025..20ee3b9 100644 --- a/guix-data-service/web/compare/controller.scm +++ b/guix-data-service/web/compare/controller.scm @@ -649,7 +649,24 @@ mime-types) ((application/json) (render-json - '((error . "invalid query")))) + `((error . "invalid query") + (query_parameters + . + ,(map + (match-lambda + ((name . val) + (cons + name + (if (invalid-query-parameter? val) + `((invalid + . ,(with-output-to-string + (lambda () + (sxml->html + (invalid-query-parameter-message + val))))) + (value . ,(invalid-query-parameter-value val))) + val)))) + query-parameters))))) (else (letpar& ((systems (with-thread-postgresql-connection |