0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 00:10:11 -05:00

Merge pull request #4405 from penpot/niwinz-staging-bugfix-7

🐛 Fix incorrect team features handling on onboarding team creation
This commit is contained in:
Alejandro 2024-04-10 16:02:35 +02:00 committed by GitHub
commit 7d4b2b1bb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 8 deletions

View file

@ -869,7 +869,12 @@
::sm/params schema:create-team-with-invitations}
[{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id emails role] :as params}]
(db/with-atomic [conn pool]
(let [params (assoc params :profile-id profile-id)
(let [features (-> (cfeat/get-enabled-features cf/flags)
(cfeat/check-client-features! (:features params)))
params (assoc params
:profile-id profile-id
:features features)
cfg (assoc cfg ::db/conn conn)
team (create-team cfg params)
profile (db/get-by-id conn :profile profile-id)

View file

@ -425,11 +425,11 @@
(let [{:keys [on-success on-error]
:or {on-success identity
on-error rx/throw}} (meta params)
features (features/get-enabled-features state)]
params {:name name
:emails #{emails}
:role role
:features features}
features (features/get-enabled-features state)
params {:name name
:emails emails
:role role
:features features}]
(->> (rp/cmd! :create-team-with-invitations params)
(rx/tap on-success)
(rx/map team-created)

View file

@ -154,7 +154,7 @@
params (:clean-data @form)
emails (:emails params)
roles (mf/use-memo #(get-available-roles))
roles (mf/use-memo get-available-roles)
on-success
(mf/use-fn
@ -168,7 +168,7 @@
on-error
(mf/use-fn
(fn [_form _response]
(fn [_form _cause]
(st/emit! (msg/error "Error on creating team."))))
;; The SKIP branch only creates the team, without invitations