refactor(client): replace hardcoded API URLs with ApiRoutes constants
Centralizes all API endpoint strings in ApiRoutes for consistency and easier maintenance. Adds Hubs class for SignalR endpoints. Removes completed plan files.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Net.Http.Json;
|
||||
using JdeScoping.Client.Auth;
|
||||
using JdeScoping.Core.ApiContracts;
|
||||
using JdeScoping.Core.Models.Auth;
|
||||
|
||||
namespace JdeScoping.Client.Services;
|
||||
@@ -43,7 +44,7 @@ public class AuthService : IAuthService
|
||||
var request = new EncryptedLoginRequest(encryptedData);
|
||||
|
||||
// Send encrypted request
|
||||
var response = await _httpClient.PostAsJsonAsync("api/auth/login", request);
|
||||
var response = await _httpClient.PostAsJsonAsync(ApiRoutes.Auth.Login, request);
|
||||
|
||||
var result = await response.Content.ReadFromJsonAsync<LoginResultModel>();
|
||||
if (result is null)
|
||||
@@ -72,7 +73,7 @@ public class AuthService : IAuthService
|
||||
{
|
||||
try
|
||||
{
|
||||
await _httpClient.PostAsync("api/auth/logout", null);
|
||||
await _httpClient.PostAsync(ApiRoutes.Auth.Logout, null);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user