0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 16:21:57 -05:00

🐛 Don't allow remove default teams.

This commit is contained in:
Andrey Antukh 2021-08-04 10:54:04 +02:00
parent 1e35116d8f
commit e7d1647769

View file

@ -125,6 +125,10 @@
(s/def ::delete-team
(s/keys :req-un [::profile-id ::id]))
;; TODO: right now just don't allow delete default team, in future it
;; should raise a speific exception for signal that this acction is
;; not allowed.
(sv/defmethod ::delete-team
[{:keys [pool] :as cfg} {:keys [id profile-id] :as params}]
(db/with-atomic [conn pool]
@ -135,7 +139,7 @@
(db/update! conn :team
{:deleted-at (dt/now)}
{:id id})
{:id id :is-default false})
nil)))