mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
Merge pull request #7494 from penpot/niwinz-staging-hotfix-3
✨ Use system clock for check invitation expiration
This commit is contained in:
@@ -443,13 +443,18 @@
|
|||||||
[:team-id ::sm/uuid]])
|
[:team-id ::sm/uuid]])
|
||||||
|
|
||||||
(def sql:team-invitations
|
(def sql:team-invitations
|
||||||
"select email_to as email, role, (valid_until < now()) as expired
|
"SELECT email_to AS email,
|
||||||
from team_invitation where team_id = ? order by valid_until desc, created_at desc")
|
role,
|
||||||
|
(valid_until < ?::timestamptz) AS expired
|
||||||
|
FROM team_invitation
|
||||||
|
WHERE team_id = ?
|
||||||
|
ORDER BY valid_until DESC, created_at DESC")
|
||||||
|
|
||||||
(defn get-team-invitations
|
(defn get-team-invitations
|
||||||
[conn team-id]
|
[conn team-id]
|
||||||
(->> (db/exec! conn [sql:team-invitations team-id])
|
(let [now (ct/now)]
|
||||||
(mapv #(update % :role keyword))))
|
(->> (db/exec! conn [sql:team-invitations now team-id])
|
||||||
|
(mapv #(update % :role keyword)))))
|
||||||
|
|
||||||
(sv/defmethod ::get-team-invitations
|
(sv/defmethod ::get-team-invitations
|
||||||
{::doc/added "1.17"
|
{::doc/added "1.17"
|
||||||
|
|||||||
Reference in New Issue
Block a user