summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-04-20 11:26:41 +0800
committereltrac <hi@eltr.ac>2026-04-20 11:26:41 +0800
commit7bf0dbf6f54c40751db9a0986e14f23b78abb564 (patch)
tree991cadca6ae225dd80b6db8a082e812a80f4ae9a
parent4e4cf91eb48a7ad6a2f7f5324ab5b586bbba23fb (diff)
fix: /api/mentions returns null
-rw-r--r--src/weepinbell/retriever.clj20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/weepinbell/retriever.clj b/src/weepinbell/retriever.clj
index bcbdd98..3db4aa4 100644
--- a/src/weepinbell/retriever.clj
+++ b/src/weepinbell/retriever.clj
@@ -44,10 +44,10 @@
([domain]
(by-domain domain nil))
([domain typ]
- (->> (storage/get-wms-by-domain domain)
- wrap-response-list
- (filter-response-by-mftype typ)
- respond-json)))
+ (cond->> (storage/get-wms-by-domain domain)
+ true wrap-response-list
+ typ (filter-response-by-mftype typ)
+ true respond-json)))
(defn by-url
"Get webmention sent to a particular URL."
@@ -55,12 +55,12 @@
(by-url url nil))
([url typ]
(if url
- (->> (get-domain url)
- storage/get-wms-by-domain
- (filter #(= url (get-in % [:webmention :target])))
- wrap-response-list
- (filter-response-by-mftype typ)
- respond-json)
+ (cond->> (get-domain url)
+ true storage/get-wms-by-domain
+ true (filter #(= url (get-in % [:webmention :target])))
+ true wrap-response-list
+ typ (filter-response-by-mftype typ)
+ true respond-json)
;; if no url query is passed
(respond-json {:status 400
:message "Missing URL. Specify target URL whose webmentions you are querying."}