From 9aad6f4db3b5907f22b1d8abbc3ba0d72afa6bb6 Mon Sep 17 00:00:00 2001 From: eltrac Date: Wed, 8 Apr 2026 18:10:27 +0800 Subject: feat!(API): flatten microformats data in JSON response --- src/weepinbell/retriever.clj | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/weepinbell/retriever.clj b/src/weepinbell/retriever.clj index f05e643..681229d 100644 --- a/src/weepinbell/retriever.clj +++ b/src/weepinbell/retriever.clj @@ -29,14 +29,16 @@ (defn by-domain "Get webmentions sent to a particular domain." [domain] - (let [data (storage/get-wms-by-domain domain)] - (respond-json data))) + (-> (storage/get-wms-by-domain domain) + wrap-response-list + respond-json)) (defn by-domain-path "Get webmention sent to a particular path on a particular domain. More flexible than bare URL." [domain path] - (let [data (storage/get-wms-by-domain domain path)] - (respond-json data))) + (-> (storage/get-wms-by-domain domain path) + wrap-response-list + respond-json)) (defn by-url "Get webmention sent to a particular URL." @@ -53,10 +55,14 @@ (defn by-id "Get one specific webmention by ID." [id] - (respond-webmention-json (storage/get-wm id))) + (-> (storage/get-wm id) + wrap-response-object + respond-webmention-json)) (defn by-st-pair "Get one specific webmention by source and target." [source target] - (respond-webmention-json (storage/get-wm source target))) + (-> (storage/get-wm source target) + wrap-response-object + respond-webmention-json)) -- cgit v1.2.3