diff options
| author | eltrac <hi@eltr.ac> | 2026-04-08 18:10:27 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-04-08 18:10:27 +0800 |
| commit | 9aad6f4db3b5907f22b1d8abbc3ba0d72afa6bb6 (patch) | |
| tree | 9c71b56a390867352aae625f6f39d693cc4fc665 /src | |
| parent | a049ec90fa9974adc5dd0dc85931b8437749ac39 (diff) | |
feat!(API): flatten microformats data in JSON response
Diffstat (limited to 'src')
| -rw-r--r-- | src/weepinbell/retriever.clj | 18 |
1 files changed, 12 insertions, 6 deletions
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)) |
