[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Include data in JSON response for the branch page
From: |
Christopher Baines |
Subject: |
branch master updated: Include data in JSON response for the branch page |
Date: |
Sat, 28 Mar 2020 10:15:16 -0400 |
This is an automated email from the git hooks/post-receive script.
cbaines pushed a commit to branch master
in repository data-service.
The following commit(s) were added to refs/heads/master by this push:
new f980b6c Include data in JSON response for the branch page
f980b6c is described below
commit f980b6c2acd4388627b5abb30bdf98fcbb18fb7f
Author: spf50 <address@hidden>
AuthorDate: Sat Mar 28 02:10:23 2020 +0100
Include data in JSON response for the branch page
Signed-off-by: Christopher Baines <address@hidden>
---
guix-data-service/web/repository/controller.scm | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/guix-data-service/web/repository/controller.scm
b/guix-data-service/web/repository/controller.scm
index 2776773..6735d10 100644
--- a/guix-data-service/web/repository/controller.scm
+++ b/guix-data-service/web/repository/controller.scm
@@ -74,7 +74,22 @@
'(application/json text/html)
mime-types)
((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
(render-html
#:sxml (if (any-invalid-query-parameters? parsed-query-parameters)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Include data in JSON response for the branch page,
Christopher Baines <=