Skip to content

Commit

Permalink
fix delete invitation
Browse files Browse the repository at this point in the history
  • Loading branch information
fiji-flo committed Feb 18, 2020
1 parent 4643614 commit cc8a4a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/db/operations/invitations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn delete_invitation(
host: User,
member: User,
) -> Result<(), Error> {
INVITE_MEMBER.run(&RuleContext::minimal(
DELETE_INVITATION.run(&RuleContext::minimal(
pool,
scope_and_user,
&group_name,
Expand Down Expand Up @@ -55,11 +55,12 @@ pub fn update_invitation(
invitation_expiration: Option<NaiveDateTime>,
group_expiration: Option<i32>,
) -> Result<(), Error> {
INVITE_MEMBER.run(&RuleContext::minimal(
INVITE_MEMBER.run(&RuleContext::minimal_with_member_uuid(
pool,
scope_and_user,
&group_name,
&host.user_uuid,
&member.user_uuid,
))?;
let connection = pool.get()?;
update(
Expand Down
4 changes: 4 additions & 0 deletions src/rules/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ pub const SEARCH_USERS: Engine = Engine {
rules: &[&rule_host_can_invite],
};

pub const DELETE_INVITATION: Engine = Engine {
rules: &[&rule_host_can_invite],
};

pub const INVITE_MEMBER: Engine = Engine {
rules: &[&rule_host_can_invite, &member_can_join, &user_not_a_member],
};
Expand Down

0 comments on commit cc8a4a5

Please sign in to comment.