fix: corrigir obter usuário
This commit is contained in:
parent
3e84e8d7a6
commit
4ed2d2243d
@ -24,8 +24,12 @@ namespace QRRapidoApp.Services
|
||||
try
|
||||
{
|
||||
if (_context.Users == null) return null; // Development mode without MongoDB
|
||||
|
||||
var userData = await _context.Users.Find(u => u.Id == userId).FirstOrDefaultAsync();
|
||||
User? userData = null;
|
||||
|
||||
if (!String.IsNullOrEmpty(userId))
|
||||
{
|
||||
userData = await _context.Users.Find(u => u.Id == userId).FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
return userData ?? new User();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user