From 5f21458a8f5319448762fef61f17b7414e7905c7 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 22 May 2023 17:25:44 +0100 Subject: [PATCH] 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. --- guix-data-service/web/compare/controller.scm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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