Добавьте файлы проекта.

This commit is contained in:
FrigaT
2026-04-13 14:16:44 +03:00
parent b2b5a3945a
commit 37c997dbe0
120 changed files with 5364 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
using PlaylistShared.Shared.DTO;
using System.Net.Http.Json;
namespace PlaylistShared.Pwa.Services;
public class ApiClient
{
private readonly HttpClient _http;
public ApiClient(HttpClient http) => _http = http;
public async Task<LoginResponse?> RefreshTokenAsync(string? refreshToken)
{
var response = await _http.PostAsJsonAsync("/api/account/refresh-token", new RefreshTokenRequest { RefreshToken = refreshToken });
if (!response.IsSuccessStatusCode) return null;
var apiResponse = await response.Content.ReadFromJsonAsync<ApiResponse<LoginResponse>>();
return apiResponse?.Data;
}
}