From a19d2b2a42a4d5c2321bfe60629b1903714cfd38 Mon Sep 17 00:00:00 2001 From: fede Date: Mon, 13 Jan 2025 17:59:21 -0300 Subject: [PATCH] termine lo que corresponde a logear los contratos --- .../Controllers/NotificacionesController.cs | 10 ++++++ .../ModalVeryAceptarContrato.svelte | 2 +- .../Componentes/NavBarAutocompletable.svelte | 34 +++++++++++++++++-- Modelo/RepositorioContratos.cs | 4 +-- Modelo/RepositorioNotificaciones.cs | 7 ++++ 5 files changed, 51 insertions(+), 6 deletions(-) diff --git a/Aspnet/Controllers/NotificacionesController.cs b/Aspnet/Controllers/NotificacionesController.cs index 1eb040e..fa8a141 100644 --- a/Aspnet/Controllers/NotificacionesController.cs +++ b/Aspnet/Controllers/NotificacionesController.cs @@ -34,6 +34,16 @@ public class NotificacionesController: ControllerBase { return Ok(noti); } + [HttpGet("api/notificaciones/haySinLeer")] + public IActionResult GetHayNotis([FromHeader(Name ="Auth")]string Auth) { + if (String.IsNullOrWhiteSpace(Auth)) return Unauthorized(); + + 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?)"}); + + bool ret = RepositorioNotificaciones.Singleton.HayNotis(cli.Dni); + return Ok(new {message = ret}); + } [HttpPut("api/notificaciones")] public IActionResult MarcarComoLeido([FromHeader(Name = "Auth")]string Auth, NotificacionMarcarLeidoDto nota) { diff --git a/Front/src/Componentes/ModalVeryAceptarContrato.svelte b/Front/src/Componentes/ModalVeryAceptarContrato.svelte index a9e8913..92cbbd4 100644 --- a/Front/src/Componentes/ModalVeryAceptarContrato.svelte +++ b/Front/src/Componentes/ModalVeryAceptarContrato.svelte @@ -41,7 +41,7 @@