private async Task OnClickHandle(int starNumber)
        {
            var authState = await AuthenticationState;
            var user      = authState.User;

            if (!user.Identity.IsAuthenticated)
            {
                await DisplayMessage.DisplayError("You must login in order to vote!");

                return;
            }

            SelectedRating = starNumber;
            voted          = true;
            await OnVote.InvokeAsync(SelectedRating);
        }
Exemple #2
0
        private async Task RemoveRole()
        {
            if (selectedRole == "0")
            {
                await DisplayMessage.DisplayError("You must select a role");

                return;
            }

            await UsersRepository.RemoveRole(new EditRoleDTO()
            {
                RoleName = selectedRole, UserId = UserId
            });

            await DisplayMessage.DisplaySuccess("Role removed");
        }