From 1e35116d8f6edfa6479615320cb1d0ba1dbc3374 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 4 Aug 2021 10:50:21 +0200 Subject: [PATCH] :bug: Don't allow remove default projects. --- backend/src/app/rpc/mutations/projects.clj | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/app/rpc/mutations/projects.clj b/backend/src/app/rpc/mutations/projects.clj index 357b3841cb..1a4598db43 100644 --- a/backend/src/app/rpc/mutations/projects.clj +++ b/backend/src/app/rpc/mutations/projects.clj @@ -117,11 +117,15 @@ (s/def ::delete-project (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 [{:keys [pool] :as cfg} {:keys [id profile-id] :as params}] (db/with-atomic [conn pool] (proj/check-edition-permissions! conn profile-id id) (db/update! conn :project {:deleted-at (dt/now)} - {:id id}) + {:id id :is-default false}) nil))