guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: Add an unimplemented JSON response for the branch


From: Christopher Baines
Subject: branch master updated: Add an unimplemented JSON response for the branch page
Date: Thu, 26 Mar 2020 05:14:17 -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 00bc653  Add an unimplemented JSON response for the branch page
00bc653 is described below

commit 00bc6535f97cac86a91339f492256888d1fff512
Author: Christopher Baines <address@hidden>
AuthorDate: Thu Mar 26 09:14:00 2020 +0000

    Add an unimplemented JSON response for the branch page
---
 guix-data-service/web/repository/controller.scm | 40 ++++++++++++++-----------
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/guix-data-service/web/repository/controller.scm 
b/guix-data-service/web/repository/controller.scm
index f31c41f..2776773 100644
--- a/guix-data-service/web/repository/controller.scm
+++ b/guix-data-service/web/repository/controller.scm
@@ -70,23 +70,29 @@
              `((after_date     ,parse-datetime)
                (before_date    ,parse-datetime)
                (limit_results  ,parse-result-limit #:default 100)))))
-       (render-html
-        #:sxml (if (any-invalid-query-parameters? parsed-query-parameters)
-                   (view-branch repository-id
-                                branch-name parsed-query-parameters '())
-                   (view-branch
-                    repository-id
-                    branch-name
-                    parsed-query-parameters
-                    (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)))))))
+       (case (most-appropriate-mime-type
+              '(application/json text/html)
+              mime-types)
+         ((application/json)
+          (render-json '((error . "unimplemented")))) ; TODO
+         (else
+          (render-html
+           #:sxml (if (any-invalid-query-parameters? parsed-query-parameters)
+                      (view-branch repository-id
+                                   branch-name parsed-query-parameters '())
+                      (view-branch
+                       repository-id
+                       branch-name
+                       parsed-query-parameters
+                       (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)))))))))
     (('GET "repository" repository-id "branch" branch-name "package" 
package-name)
      (let ((package-versions
             (package-versions-for-branch conn



reply via email to

[Prev in Thread] Current Thread [Next in Thread]