mirror of
https://github.com/penpot/penpot.git
synced 2025-03-15 17:21:17 -05:00
🐛 Don't allow remove default projects.
This commit is contained in:
parent
35ca3ec895
commit
1e35116d8f
1 changed files with 5 additions and 1 deletions
|
@ -117,11 +117,15 @@
|
||||||
(s/def ::delete-project
|
(s/def ::delete-project
|
||||||
(s/keys :req-un [::id ::profile-id]))
|
(s/keys :req-un [::id ::profile-id]))
|
||||||
|
|
||||||
|
;; TODO: right now, we just don't allow delete default projects, in a
|
||||||
|
;; future we need to ensure raise a correct exception signaling that
|
||||||
|
;; this is not allowed.
|
||||||
|
|
||||||
(sv/defmethod ::delete-project
|
(sv/defmethod ::delete-project
|
||||||
[{:keys [pool] :as cfg} {:keys [id profile-id] :as params}]
|
[{:keys [pool] :as cfg} {:keys [id profile-id] :as params}]
|
||||||
(db/with-atomic [conn pool]
|
(db/with-atomic [conn pool]
|
||||||
(proj/check-edition-permissions! conn profile-id id)
|
(proj/check-edition-permissions! conn profile-id id)
|
||||||
(db/update! conn :project
|
(db/update! conn :project
|
||||||
{:deleted-at (dt/now)}
|
{:deleted-at (dt/now)}
|
||||||
{:id id})
|
{:id id :is-default false})
|
||||||
nil))
|
nil))
|
||||||
|
|
Loading…
Add table
Reference in a new issue