diff --git a/backend/src/app/db.clj b/backend/src/app/db.clj index a40318a99..50b492800 100644 --- a/backend/src/app/db.clj +++ b/backend/src/app/db.clj @@ -219,15 +219,6 @@ :else (ex/raise :type :not-implemented))) -(defn decode-pgobject - [^PGobject obj] - (let [typ (.getType obj) - val (.getValue obj)] - (if (or (= typ "json") - (= typ "jsonb")) - (json/read-str val) - val))) - (defn decode-json-pgobject [^PGobject o] (let [typ (.getType o) diff --git a/backend/src/app/tasks/remove_media.clj b/backend/src/app/tasks/remove_media.clj index a517aadd2..2d1a52858 100644 --- a/backend/src/app/tasks/remove_media.clj +++ b/backend/src/app/tasks/remove_media.clj @@ -76,7 +76,7 @@ [_task] (letfn [(decode-row [{:keys [data] :as row}] (cond-> row - (db/pgobject? data) (assoc :data (db/decode-pgobject data)))) + (db/pgobject? data) (assoc :data (db/decode-json-pgobject data)))) (retrieve-items [conn] (->> (db/exec! conn [sql:retrieve-peding-to-delete 10]) (map decode-row)