diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Controllers/AccountsController.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Controllers/AccountsController.cs index 56ea67a..a2b60a5 100644 --- a/WatchIt.WebAPI/WatchIt.WebAPI.Controllers/AccountsController.cs +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Controllers/AccountsController.cs @@ -94,11 +94,11 @@ public class AccountsController(IAccountsControllerService accountsControllerSer #region Info - [HttpGet("{id}/info")] + [HttpGet("{id}")] [AllowAnonymous] [ProducesResponseType(typeof(AccountResponse), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] - public async Task GetAccountInfo([FromRoute]long id) => await accountsControllerService.GetAccountInfo(id); + public async Task GetAccount([FromRoute]long id) => await accountsControllerService.GetAccount(id); [HttpPut("profile_info")] [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Accounts/AccountsControllerService.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Accounts/AccountsControllerService.cs index cb6a052..0570ff3 100644 --- a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Accounts/AccountsControllerService.cs +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Accounts/AccountsControllerService.cs @@ -238,7 +238,7 @@ public class AccountsControllerService( #region Info - public async Task GetAccountInfo(long id) + public async Task GetAccount(long id) { Account? account = await database.Accounts.FirstOrDefaultAsync(x => x.Id == id); if (account is null) diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Accounts/IAccountsControllerService.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Accounts/IAccountsControllerService.cs index 0728d3e..34996cb 100644 --- a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Accounts/IAccountsControllerService.cs +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Accounts/IAccountsControllerService.cs @@ -19,7 +19,7 @@ public interface IAccountsControllerService Task GetAccountProfileBackground(long id); Task PutAccountProfileBackground(AccountProfileBackgroundRequest data); Task DeleteAccountProfileBackground(); - Task GetAccountInfo(long id); + Task GetAccount(long id); Task PutAccountProfileInfo(AccountProfileInfoRequest data); Task PatchAccountUsername(AccountUsernameRequest data); Task PatchAccountEmail(AccountEmailRequest data); diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Accounts/AccountsClientService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Accounts/AccountsClientService.cs index 49e0344..01e50de 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Accounts/AccountsClientService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Accounts/AccountsClientService.cs @@ -150,9 +150,9 @@ public class AccountsClientService(IHttpClientService httpClientService, IConfig .ExecuteAction(); } - public async Task GetAccountInfo(long id, Action? successAction = null, Action? notFoundAction = null) + public async Task GetAccount(long id, Action? successAction = null, Action? notFoundAction = null) { - string url = GetUrl(EndpointsConfiguration.Accounts.GetAccountInfo, id); + string url = GetUrl(EndpointsConfiguration.Accounts.GetAccount, id); HttpRequest request = new HttpRequest(HttpMethodType.Get, url); HttpResponse response = await httpClientService.SendRequestAsync(request); diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Accounts/IAccountsClientService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Accounts/IAccountsClientService.cs index 84b48f5..7b0e4cc 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Accounts/IAccountsClientService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Accounts/IAccountsClientService.cs @@ -18,7 +18,7 @@ public interface IAccountsClientService Task GetAccountProfileBackground(long id, Action? successAction = null, Action>? badRequestAction = null, Action? notFoundAction = null); Task PutAccountProfileBackground(AccountProfileBackgroundRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null); Task DeleteAccountProfileBackground(Action? successAction = null, Action? unauthorizedAction = null); - Task GetAccountInfo(long id, Action? successAction = null, Action? notFoundAction = null); + Task GetAccount(long id, Action? successAction = null, Action? notFoundAction = null); Task PutAccountProfileInfo(AccountProfileInfoRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null); Task PatchAccountUsername(AccountUsernameRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null); Task PatchAccountEmail(AccountEmailRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null); diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Accounts.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Accounts.cs index fae7f58..1479b8d 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Accounts.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Accounts.cs @@ -13,7 +13,7 @@ public class Accounts public string GetAccountProfileBackground { get; set; } public string PutAccountProfileBackground { get; set; } public string DeleteAccountProfileBackground { get; set; } - public string GetAccountInfo { get; set; } + public string GetAccount { get; set; } public string PutAccountProfileInfo { get; set; } public string PatchAccountUsername { get; set; } public string PatchAccountEmail { get; set; } diff --git a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.cs b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.cs index 00657c8..76d3d6c 100644 --- a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.cs @@ -91,7 +91,7 @@ public partial class MainLayout : LayoutComponentBase if (_user is not null) { - await AccountsClientService.GetAccountInfo(_user.Id, data => _accountData = data); + await AccountsClientService.GetAccount(_user.Id, data => _accountData = data); } _loaded = true; diff --git a/WatchIt.Website/WatchIt.Website/Pages/UserEditPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/UserEditPage.razor.cs index 4b29a60..cb179b4 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/UserEditPage.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Pages/UserEditPage.razor.cs @@ -58,7 +58,7 @@ public partial class UserEditPage : ComponentBase await Task.WhenAll( [ - AccountsClientService.GetAccountInfo(user.Id, data => _accountData = data), + AccountsClientService.GetAccount(user.Id, data => _accountData = data), AccountsClientService.GetAccountProfileBackground(user.Id, data => Layout.BackgroundPhoto = data) ]); StateHasChanged(); diff --git a/WatchIt.Website/WatchIt.Website/Pages/UserPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/UserPage.razor.cs index 95087f0..41cec0a 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/UserPage.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Pages/UserPage.razor.cs @@ -91,7 +91,7 @@ public partial class UserPage : ComponentBase Id = user.Id; } - await AccountsClientService.GetAccountInfo(Id.Value, data => _accountData = data); + await AccountsClientService.GetAccount(Id.Value, data => _accountData = data); _owner = Id.Value == user?.Id; } diff --git a/WatchIt.Website/WatchIt.Website/appsettings.json b/WatchIt.Website/WatchIt.Website/appsettings.json index 943633b..8099a36 100644 --- a/WatchIt.Website/WatchIt.Website/appsettings.json +++ b/WatchIt.Website/WatchIt.Website/appsettings.json @@ -27,7 +27,7 @@ "GetAccountProfileBackground": "/{0}/profile_background", "PutAccountProfileBackground": "/profile_background", "DeleteAccountProfileBackground": "/profile_background", - "GetAccountInfo": "/{0}/info", + "GetAccount": "/{0}", "PutAccountProfileInfo": "/profile_info", "PatchAccountUsername": "/username", "PatchAccountEmail": "/email",