From ddfe2f7406caab62e3fd8cf5944ef5f22ddccdeb Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Tue, 12 May 2026 12:32:05 +0200 Subject: [PATCH] :sparkles: Remove nitrate teams with expired license from the teams list --- backend/src/app/rpc/commands/teams.clj | 4 +++- common/src/app/common/types/organization.cljc | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/app/rpc/commands/teams.clj b/backend/src/app/rpc/commands/teams.clj index 45b029e987..542c77adbd 100644 --- a/backend/src/app/rpc/commands/teams.clj +++ b/backend/src/app/rpc/commands/teams.clj @@ -194,7 +194,9 @@ (dm/with-open [conn (db/open pool)] (cond->> (get-teams conn profile-id) (contains? cf/flags :nitrate) - (map #(nitrate/add-org-info-to-team cfg % params))))) + (map #(nitrate/add-org-info-to-team cfg % params)) + (contains? cf/flags :nitrate) + (remove #(get-in % [:organization :expired-license]))))) (def ^:private sql:get-owned-teams "SELECT t.id, t.name, diff --git a/common/src/app/common/types/organization.cljc b/common/src/app/common/types/organization.cljc index aa6455d32c..7a817d9e8b 100644 --- a/common/src/app/common/types/organization.cljc +++ b/common/src/app/common/types/organization.cljc @@ -16,6 +16,7 @@ [:owner-id ::sm/uuid] [:avatar-bg-url ::sm/uri] [:logo-id {:optional true} [:maybe ::sm/uuid]] + [:expired-license {:optional true} [:maybe :boolean]] [:permissions {:optional true} [:maybe [:map [:create-teams {:optional true} [:maybe [:enum "any" "onlyMe"]]] @@ -30,7 +31,7 @@ (def organization->team-keys "Organization field keys to include in the nested :organization map." - [:id :name :custom-photo :slug :avatar-bg-url :owner-id :permissions]) + [:id :name :custom-photo :slug :avatar-bg-url :owner-id :expired-license :permissions]) (defn apply-organization "Updates a team map with organization fields in a nested :organization map.