Exemplo n.º 1
0
        public IActionResult DeleteInvite(User user)
        {
            user = userDAL.GetUser(user.Email);

            userDAL.DeleteInvite(user);

            InviteResponse ir = new InviteResponse()
            {
                Invitee = user,
                Inviter = user.Invite.InvitedBy,
                Family  = familyDAL.GetFamily(user.Invite.FamilyId)
            };

            emailProvider.DeclineInvite(ir);

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public IActionResult DeleteInvite(User user)
        {
            user = userDAL.GetUser(user.Email);
            ObjectResult output = StatusCode(500, error.DeleteInvite);

            if (user != null)
            {
                if (userDAL.DeleteInvite(user))
                {
                    output = StatusCode(200, authProvider.GetCurrentUser());

                    InviteResponse ir = new InviteResponse()
                    {
                        Invitee = user,
                        Inviter = user.Invite.InvitedBy,
                        Family  = familyDAL.GetFamily(user.Invite.FamilyId)
                    };

                    emailProvider.DeclineInvite(ir);
                }
            }

            return(output);
        }