summaryrefslogtreecommitdiff
path: root/api.scm
diff options
context:
space:
mode:
authorJakob L. Kreuze <zerodaysfordays@sdf.org>2024-09-02 16:06:32 -0400
committerJakob L. Kreuze <zerodaysfordays@sdf.org>2024-09-02 16:06:32 -0400
commitcb8c10825ba73153704f214be84b16494dab8d4b (patch)
treeda03cee7c5578798bfb2bc0bbc389dd71e7b6511 /api.scm
parentdc8597dd791a1defd5fd86a596954fedb8ceaf3f (diff)
[dynamic] Add endpoint for fetching all comments
Diffstat (limited to 'api.scm')
-rw-r--r--api.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/api.scm b/api.scm
index e3b121d..43660eb 100644
--- a/api.scm
+++ b/api.scm
@@ -89,12 +89,13 @@
(apply values
(guard (ex ((reportable-condition? ex)
(values->list (format-error-response ex)))
- ((equal? "application/json" (assoc-ref (request-headers request) 'accept))
+ ((and (equal? "application/json" (assoc-ref (request-headers request) 'accept))
+ (not (%debug-enabled)))
(dump-error request body endpoint)
(list (build-response #:code 500)
(scm->json-string
'((success . #f) (error . "Internal error.")))))
- (#t
+ ((not (%debug-enabled))
(dump-error request body endpoint)
(list (build-response #:code 500) "Internal server error.")))
(fail-when-ip-blacklisted originating-ip)
@@ -104,6 +105,7 @@
(('GET "apps" "comment-form" _) get-comment-form)
('(GET "api" "challenge" "proof-of-work") make-pow-challenge!)
('(GET "api" "challenge" "captcha") make-captcha-challenge!)
+ ('(GET "api" "all-comments") get-all-comments)
('(GET "api" "comments") get-comments)
(('POST "api" "comment") put-comment)
(('POST "api" "comment" "react") put-reaction)