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:
Joseph Doherty
2026-01-28 08:33:48 -05:00
parent 1e21e33ade
commit daaeba2004
9 changed files with 22 additions and 1368 deletions
@@ -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
{