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.
This commit is contained in:
Christopher Baines 2023-05-22 17:25:44 +01:00
parent 54c7a1a880
commit 5f21458a8f

View file

@ -649,7 +649,24 @@
mime-types) mime-types)
((application/json) ((application/json)
(render-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 (else
(letpar& ((systems (letpar& ((systems
(with-thread-postgresql-connection (with-thread-postgresql-connection