diff --git a/resources/sql/queries.sql b/resources/sql/queries.sql index 4495bcc..e282898 100644 --- a/resources/sql/queries.sql +++ b/resources/sql/queries.sql @@ -358,7 +358,7 @@ WHERE issue_id = :issue_id; -- :name issue-exists :1 --- :doc updates issue's open status +-- :doc returns true if given issue exists SELECT exists(SELECT 1 FROM issues WHERE issue_id = :issue_id); diff --git a/src/clj/commiteth/db/issues.clj b/src/clj/commiteth/db/issues.clj index 0ced020..ac59552 100644 --- a/src/clj/commiteth/db/issues.clj +++ b/src/clj/commiteth/db/issues.clj @@ -92,4 +92,7 @@ [issue-id] (let [res (jdbc/with-db-connection [con-db *db*] (db/issue-exists con-db {:issue_id issue-id}))] - res)) + (-> res + first + :exists + boolean)))