🐛 Fix resend invitation doesn't reset the expiration date

This commit is contained in:
Pablo Alba 2023-01-27 16:55:08 +01:00
parent 50b7337b8c
commit 6e698110d6
3 changed files with 5 additions and 3 deletions

View file

@ -641,7 +641,7 @@
"insert into team_invitation(team_id, email_to, role, valid_until)
values (?, ?, ?, ?)
on conflict(team_id, email_to) do
update set role = ?, updated_at = now();")
update set role = ?, valid_until = ?, updated_at = now();")
(defn- create-invitation-token
[cfg {:keys [profile-id valid-until team-id member-id member-email role]}]
@ -712,7 +712,7 @@
{:id (:id member)})))
(do
(db/exec-one! conn [sql:upsert-team-invitation
(:id team) (str/lower email) (name role) expire (name role)])
(:id team) (str/lower email) (name role) expire (name role) expire])
(eml/send! {::eml/conn conn
::eml/factory eml/invite-to-team
:public-uri (cf/get :public-uri)