From 387d47757fa326a6c05026620b92207940b64899 Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Wed, 1 Mar 2017 12:14:29 +0100 Subject: [PATCH] No need to return `:exists? true` when resource exists --- src/asciinema/endpoint/asciicasts.clj | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/asciinema/endpoint/asciicasts.clj b/src/asciinema/endpoint/asciicasts.clj index a4517ae..0a038b5 100644 --- a/src/asciinema/endpoint/asciicasts.clj +++ b/src/asciinema/endpoint/asciicasts.clj @@ -60,8 +60,7 @@ :query {(s/optional-key :dl) s/Bool}} :properties (fn [ctx] (if-let [asciicast (adb/get-asciicast-by-token db (-> ctx :parameters :path :token))] - {:exists? true - ::asciicast asciicast} + {::asciicast asciicast} {:exists? false})) :response (fn [ctx] (let [asciicast (-> ctx :properties ::asciicast) @@ -85,8 +84,7 @@ time (assoc :snapshot-at time) theme (assoc :theme theme) scale (assoc :scale (Integer/parseInt scale)))] - {:exists? true - :version (asciicast/png-version asciicast png-params) + {:version (asciicast/png-version asciicast png-params) ::asciicast asciicast ::png-params png-params}) {:exists? false}))