Skip to content

Commit cc8a4a5

Browse files
committed
fix delete invitation
1 parent 4643614 commit cc8a4a5

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/db/operations/invitations.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn delete_invitation(
2626
host: User,
2727
member: User,
2828
) -> Result<(), Error> {
29-
INVITE_MEMBER.run(&RuleContext::minimal(
29+
DELETE_INVITATION.run(&RuleContext::minimal(
3030
pool,
3131
scope_and_user,
3232
&group_name,
@@ -55,11 +55,12 @@ pub fn update_invitation(
5555
invitation_expiration: Option<NaiveDateTime>,
5656
group_expiration: Option<i32>,
5757
) -> Result<(), Error> {
58-
INVITE_MEMBER.run(&RuleContext::minimal(
58+
INVITE_MEMBER.run(&RuleContext::minimal_with_member_uuid(
5959
pool,
6060
scope_and_user,
6161
&group_name,
6262
&host.user_uuid,
63+
&member.user_uuid,
6364
))?;
6465
let connection = pool.get()?;
6566
update(

src/rules/engine.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ pub const SEARCH_USERS: Engine = Engine {
1616
rules: &[&rule_host_can_invite],
1717
};
1818

19+
pub const DELETE_INVITATION: Engine = Engine {
20+
rules: &[&rule_host_can_invite],
21+
};
22+
1923
pub const INVITE_MEMBER: Engine = Engine {
2024
rules: &[&rule_host_can_invite, &member_can_join, &user_not_a_member],
2125
};

0 commit comments

Comments
 (0)