Implement the JSON response for package substitute availability

This commit is contained in:
Christopher Baines 2022-09-14 10:37:33 +01:00
parent e3062abf33
commit ec3dba4894

View file

@ -619,7 +619,22 @@
mime-types)
((application/json)
(render-json
'())) ; TODO
`((commit . ,commit-hash)
(substitute_servers
. ,(list->vector
(map (match-lambda
((build-server-id . data)
`((server . ((url . ,(assoc-ref build-server-urls
build-server-id))))
(availability
. ,(list->vector
(map (match-lambda
((system-and-target . data)
`((system . ,(assq-ref system-and-target 'system))
(target . ,(assq-ref system-and-target 'target))
,@data)))
data))))))
substitute-availability))))))
(else
(render-html
#:sxml (view-revision-package-substitute-availability