From f0e7a96a5d4d1c6075358f5555889f6e924a9b9f Mon Sep 17 00:00:00 2001 From: Adiv <asifadiv@gmail.com> Date: Mon, 8 May 2023 06:01:45 +0100 Subject: [PATCH] fixups --- API/Group17AuthApi.cs | 11 +++-------- Pages/Profile/ProfileMain.razor | 11 +++++++---- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/API/Group17AuthApi.cs b/API/Group17AuthApi.cs index 2469c96..8012efb 100644 --- a/API/Group17AuthApi.cs +++ b/API/Group17AuthApi.cs @@ -74,7 +74,7 @@ namespace Group17.Auth /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> /// <returns>No Content</returns> /// <exception cref="APIException">A server side error occurred.</exception> - System.Threading.Tasks.Task ResendConfirmEmailAsync(string callbackUrl = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ResendConfirmEmailAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> /// <returns>No Content</returns> @@ -952,15 +952,10 @@ namespace Group17.Auth /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> /// <returns>No Content</returns> /// <exception cref="APIException">A server side error occurred.</exception> - public virtual async System.Threading.Tasks.Task ResendConfirmEmailAsync(string callbackUrl = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task ResendConfirmEmailAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Auth/ResendConfirmEmail?"); - if (callbackUrl != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("callbackUrl") + "=").Append(System.Uri.EscapeDataString(ConvertToString(callbackUrl, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; + urlBuilder_.Append("api/Auth/ResendConfirmEmail"); var client_ = _httpClient; var disposeClient_ = false; diff --git a/Pages/Profile/ProfileMain.razor b/Pages/Profile/ProfileMain.razor index 98cc9bc..8f68100 100644 --- a/Pages/Profile/ProfileMain.razor +++ b/Pages/Profile/ProfileMain.razor @@ -102,7 +102,7 @@ else </MudItem> <MudItem xs="12" sm="12"> <MudPaper Class="pa-4"> - @if (Profile == null) + @if (Profile == null && (UserId == null || UserId == UserInfo?.UserId)) { <MudForm @ref="_form" Disabled="@(UserId != null && UserInfo?.UserId != UserId)" Model="NewDetails"> <MudTextField T="string" Label="First Name" Disabled="true" Value="UserInfo.Firstname"/> @@ -126,9 +126,12 @@ else else { <MudForm @ref="_form" Disabled="@(UserId != null && UserInfo?.UserId != UserId)" Model="Profile"> - <MudTextField T="string" Label="First Name" Disabled="true" Value="UserInfo.Firstname"/> - <MudTextField T="string" Label="Surname" Disabled="true" Value="UserInfo.Surname"/> - <MudTextField T="string" Label="Email Address" Disabled="true" Value="UserInfo.EmailAddress"/> + @if (UserId == null || UserInfo?.UserId == UserId) + { + <MudTextField T="string" Label="First Name" Disabled="true" Value="@(UserInfo.Firstname)"/> + <MudTextField T="string" Label="Surname" Disabled="true" Value="UserInfo.Surname"/> + <MudTextField T="string" Label="Email Address" Disabled="true" Value="UserInfo.EmailAddress"/> + } <MudSelect T="string" Label="Gender" AnchorOrigin="Origin.TopCenter" @bind-Value="Profile.Gender"> <MudSelectItem Value="@("Male")"/> <MudSelectItem Value="@("Female")"/> -- GitLab