fix: corrigir obter usuário
All checks were successful
Deploy QR Rapido / test (push) Successful in 29s
Deploy QR Rapido / build-and-push (push) Successful in 6m52s
Deploy QR Rapido / deploy-staging (push) Has been skipped
Deploy QR Rapido / deploy-production (push) Successful in 1m51s

This commit is contained in:
Ricardo Carneiro 2025-08-12 20:06:34 -03:00
parent 3e84e8d7a6
commit 4ed2d2243d

View File

@ -24,8 +24,12 @@ namespace QRRapidoApp.Services
try try
{ {
if (_context.Users == null) return null; // Development mode without MongoDB if (_context.Users == null) return null; // Development mode without MongoDB
User? userData = null;
var userData = await _context.Users.Find(u => u.Id == userId).FirstOrDefaultAsync(); if (!String.IsNullOrEmpty(userId))
{
userData = await _context.Users.Find(u => u.Id == userId).FirstOrDefaultAsync();
}
return userData ?? new User(); return userData ?? new User();
} }