Fixed new user username formating
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using PostFundManagement.Domain.Abstractions;
|
||||
using PostFundManagement.Domain.Abstractions;
|
||||
using PostFundManagement.Domain.Errors;
|
||||
using PostFundManagement.Domain.Models.Security;
|
||||
|
||||
@@ -13,7 +13,11 @@ public class SkorubaUserService(IHttpClientFactory httpClientFactory) : ISkoruba
|
||||
var response = await httpClient.PostAsJsonAsync("api/users", request, cancellationToken);
|
||||
|
||||
if (!response.IsSuccessStatusCode)
|
||||
return Result.Fail(CreateError.Create(response.ReasonPhrase!));
|
||||
{
|
||||
var errorBody = await response.Content.ReadAsStringAsync(cancellationToken);
|
||||
var errorMsg = !string.IsNullOrWhiteSpace(errorBody) ? errorBody : response.ReasonPhrase!;
|
||||
return Result.Fail(CreateError.Create(errorMsg));
|
||||
}
|
||||
|
||||
var created = await response.Content.ReadFromJsonAsync<UserResponse>(cancellationToken: cancellationToken);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user