mirror of
https://github.com/penpot/penpot.git
synced 2025-06-07 19:11:40 +02:00
🎉 Add team invitations API
This commit is contained in:
parent
09a4cb30ec
commit
1990232adc
6 changed files with 155 additions and 10 deletions
|
@ -229,3 +229,20 @@
|
|||
(defn retrieve-team-stats
|
||||
[conn team-id]
|
||||
(db/exec-one! conn [sql:team-stats team-id team-id]))
|
||||
|
||||
|
||||
;; --- Query: Team invitations
|
||||
|
||||
(s/def ::team-id ::us/uuid)
|
||||
(s/def ::team-invitations
|
||||
(s/keys :req-un [::profile-id ::team-id]))
|
||||
|
||||
(def sql:team-invitations
|
||||
"select email_to as email, role, (valid_until < now()) as expired from team_invitation where team_id = ?")
|
||||
|
||||
|
||||
(sv/defmethod ::team-invitations
|
||||
[{:keys [pool] :as cfg} {:keys [profile-id team-id]}]
|
||||
(with-open [conn (db/open pool)]
|
||||
(check-read-permissions! conn profile-id team-id)
|
||||
(db/exec! conn [sql:team-invitations team-id])))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue