0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-20 19:51:23 -05:00

Fix image retrieval by anonymous user.

This commit is contained in:
Andrey Antukh 2017-01-30 14:50:05 +01:00
parent 3f58e1b453
commit f5004518aa
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95
2 changed files with 3 additions and 5 deletions

View file

@ -44,9 +44,7 @@ order by created_at desc;
-- :name get-image :? :1
select * from images
where id = :id
and deleted_at is null
and ("user" = :user or
"user" = '00000000-0000-0000-0000-000000000000'::uuid);
and deleted_at is null;
-- :name create-image :<! :1
insert into images ("user", name, collection, path, width, height, mimetype)

View file

@ -106,8 +106,8 @@
;; --- Retrieve Image
(defn retrieve-image
[conn {:keys [user id]}]
(let [sqlv (sql/get-image {:user user :id id})]
[conn {:keys [id]}]
(let [sqlv (sql/get-image {:id id})]
(some-> (sc/fetch-one conn sqlv)
(data/normalize-attrs))))