feat: ahora se pueden ver las propiedades dadas de baja y añadido el tema de los servicios

Signed-off-by: fede <federico.nicolas.polidoro@gmail.com>
This commit is contained in:
2024-12-06 00:01:31 -03:00
parent 5289c07d84
commit dee2031d87
12 changed files with 291 additions and 135 deletions

View File

@@ -48,11 +48,12 @@
<th>Letra</th>
<th>Piso</th>
<th>Tipo</th>
<th>Servicios</th>
</tr>
</thead>
<tbody>
{#each $propiedades as propiedad}
<RowPropiedad id={propiedad.id} ubicacion={propiedad.ubicacion} letra={propiedad.letra} piso={propiedad.piso} tipo={propiedad.tipo} canthabitaciones={propiedad.canthabitaciones} />
<RowPropiedad id={propiedad.id} ubicacion={propiedad.ubicacion} letra={propiedad.letra} piso={propiedad.piso} tipo={propiedad.tipo} canthabitaciones={propiedad.canthabitaciones} servicios={propiedad.servicios} />
{/each}
</tbody>

View File

@@ -0,0 +1,64 @@
<script lang="ts">
import { onMount } from "svelte";
import NavBarAutocompletable from "../Componentes/NavBarAutocompletable.svelte" ;
import { writable } from 'svelte/store';
import RowPropiedad from "../Componentes/RowPropiedad.svelte";
import type { PropiedadDto } from "../types";
let propiedades = writable<PropiedadDto[]>([]);
let email = localStorage.getItem("email");
let token = sessionStorage.getItem("token");
let fallo: boolean = $state(false);
onMount(async ()=> {
try {
const responce = await fetch("http://localhost:5007/api/propiedades/Propietario/Bajas", {
method: "GET",
headers: {
'Auth': String(token),
'Email' : String(email),
'Content-Type' : "application/json"
},
});
if (responce.ok){
const json = await responce.json();
propiedades.set(json);
return;
}
if (!responce.ok){
fallo = true;
}
} catch (e){
console.error(e);
}
});
</script>
<NavBarAutocompletable/>
<div class="container table-responsive">
<table class="table-responsive table table-striped">
<thead>
<tr>
<th>#</th>
<th>ubicacion</th>
<th>Habitaciones</th>
<th>Letra</th>
<th>Piso</th>
<th>Tipo</th>
<th>Servicios</th>
</tr>
</thead>
<tbody>
{#each $propiedades as propiedad}
<RowPropiedad id={propiedad.id} ubicacion={propiedad.ubicacion} letra={propiedad.letra} piso={propiedad.piso} tipo={propiedad.tipo} canthabitaciones={propiedad.canthabitaciones} servicios={propiedad.servicios} />
{/each}
</tbody>
</table>
</div>
{#if fallo}
<div class="container alert alert-danger">Fallo al intentar Obtener la lista de propiedades</div>
{/if}