falta mirar en la base de datos si guardo el tipo de moneda
This commit is contained in:
@@ -15,22 +15,25 @@ public class NotificacionesController: ControllerBase {
|
||||
var cli = RepositorioUsuarios.Singleton.ObtenerClientePorToken(Auth);
|
||||
if (cli == null) return BadRequest(new {message = "Fallo al intentar encontrar tu usuario (puede que te hayas logeado desde otro dispositivo?)"});
|
||||
|
||||
|
||||
IQueryable<Notificacione> notificaciones = RepositorioNotificaciones.Singleton.ObtenerNotificacionesDeUsuario(cli.Dni)
|
||||
.Where(x=>x.Leido == leido);
|
||||
|
||||
|
||||
List<NotificacionDto> noti = new();
|
||||
Parallel.ForEach(notificaciones, i => {
|
||||
foreach (Notificacione i in notificaciones) {
|
||||
if(i.DniclienteNavigation == null || i.DniremitenteNavigation==null) return BadRequest(new { message = "Esta mal cargado el precontrato"});
|
||||
var dto = new NotificacionDtoBuilder()
|
||||
.SetRemitente(i.DniremitenteNavigation.Email)
|
||||
.SetAccion(i.Accion)
|
||||
.SetMensaje(i.Mensaje)
|
||||
.SetRemitente(i.DniremitenteNavigation.Email??"")
|
||||
.SetAccion(i.Accion??"")
|
||||
.SetMensaje(i.Mensaje??"")
|
||||
.SetFecha(i.Fecha)
|
||||
.SetPropiedad(i.IdpropiedadNavigation.Id.ToString())
|
||||
.SetReceptor(i.DniclienteNavigation.Email)
|
||||
.SetPropiedad(i.Idpropiedad.ToString()??"")
|
||||
.SetReceptor(i.DniclienteNavigation.Email??"")
|
||||
.Build();
|
||||
|
||||
noti.Add(dto);
|
||||
});
|
||||
}
|
||||
|
||||
return Ok(noti);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user