Skip to content

Commit

Permalink
Improve implementation of grant-role
Browse files Browse the repository at this point in the history
  • Loading branch information
skydread1 committed Aug 4, 2023
1 parent b23cab1 commit 80bf6e5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions server/src/flybot/server/core/handler/operation.clj
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@

:else
(let [new-role {:role/name role-to-grant :role/date-granted (utils/mk-date)}]
{:response (-> user
(update :user/roles vec)
(update :user/roles conj new-role))
{:response (update user :user/roles #(-> % vec (conj new-role)))
:effects {:db {:payload [(assoc user :user/roles [new-role])]}}}))))

(def grant-editor-role
Expand Down

0 comments on commit 80bf6e5

Please sign in to comment.