diff --git a/src/Application/Stripe/Commands/CreateSessionCheckoutCommand.cs b/src/Application/Stripe/Commands/CreateSessionCheckoutCommand.cs index e627bf1..9014f97 100644 --- a/src/Application/Stripe/Commands/CreateSessionCheckoutCommand.cs +++ b/src/Application/Stripe/Commands/CreateSessionCheckoutCommand.cs @@ -27,6 +27,8 @@ public class CreateSessionCheckoutCommandHandler( await dbContext.UserTransactions.AddAsync(userTransaction, cancellationToken); + await dbContext.SaveChangesAsync(cancellationToken); + return stripeSecret; } } diff --git a/src/Infrastructure/Services/UserService.cs b/src/Infrastructure/Services/UserService.cs index 7fae66c..b0704c2 100644 --- a/src/Infrastructure/Services/UserService.cs +++ b/src/Infrastructure/Services/UserService.cs @@ -1,13 +1,11 @@ -using System.Security.Claims; -using Hutopy.Domain.Interfaces; +using Hutopy.Domain.Interfaces; using Hutopy.Domain.Models; using Hutopy.Infrastructure.Identity; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Identity; namespace Hutopy.Infrastructure.Services; -public class UserService(UserManager userManager, IHttpContextAccessor httpContextAccessor) : IUserService +public class UserService(UserManager userManager) : IUserService { public async Task CreateUserAsync(string email, string userName, string firstName, string lastName, string password) { @@ -48,7 +46,8 @@ public class UserService(UserManager userManager, IHttpContextA public async Task GetCurrentUserAsync() { - var userId = httpContextAccessor.HttpContext?.User.FindFirstValue(ClaimTypes.NameIdentifier); + // todo: Get the id of the user doing the request. + var userId = ""; if (string.IsNullOrEmpty(userId)) { return null;