diff options
| author | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2024-09-02 16:06:32 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2024-09-02 16:06:32 -0400 |
| commit | cb8c10825ba73153704f214be84b16494dab8d4b (patch) | |
| tree | da03cee7c5578798bfb2bc0bbc389dd71e7b6511 /api.scm | |
| parent | dc8597dd791a1defd5fd86a596954fedb8ceaf3f (diff) | |
[dynamic] Add endpoint for fetching all comments
Diffstat (limited to 'api.scm')
| -rw-r--r-- | api.scm | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) |