fix: corrigir obter usuário
This commit is contained in:
parent
3e84e8d7a6
commit
4ed2d2243d
@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user