Include data in JSON response for the branch page
Signed-off-by: Christopher Baines <mail@cbaines.net>
This commit is contained in:
parent
d1c243f7fd
commit
f980b6c2ac
1 changed files with 16 additions and 1 deletions
|
|
@ -74,7 +74,22 @@
|
||||||
'(application/json text/html)
|
'(application/json text/html)
|
||||||
mime-types)
|
mime-types)
|
||||||
((application/json)
|
((application/json)
|
||||||
(render-json '((error . "unimplemented")))) ; TODO
|
(render-json
|
||||||
|
`((revisions
|
||||||
|
. ,(list->vector
|
||||||
|
(map (match-lambda
|
||||||
|
((date commit-hash _ _)
|
||||||
|
`((date . ,date)
|
||||||
|
(commit-hash . ,commit-hash))))
|
||||||
|
(most-recent-commits-for-branch
|
||||||
|
conn
|
||||||
|
(string->number repository-id)
|
||||||
|
branch-name
|
||||||
|
#:limit (assq-ref parsed-query-parameters 'limit_results)
|
||||||
|
#:after-date (assq-ref parsed-query-parameters
|
||||||
|
'after_date)
|
||||||
|
#:before-date (assq-ref parsed-query-parameters
|
||||||
|
'before_date))))))))
|
||||||
(else
|
(else
|
||||||
(render-html
|
(render-html
|
||||||
#:sxml (if (any-invalid-query-parameters? parsed-query-parameters)
|
#:sxml (if (any-invalid-query-parameters? parsed-query-parameters)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue