paginacion arreglada
This commit is contained in:
1
Front/public/bell.svg
Normal file
1
Front/public/bell.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-bell"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 5a2 2 0 1 1 4 0a7 7 0 0 1 4 6v3a4 4 0 0 0 2 3h-16a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6" /><path d="M9 17v1a3 3 0 0 0 6 0v-1" /></svg>
|
||||
|
After Width: | Height: | Size: 447 B |
@@ -40,15 +40,25 @@
|
||||
|
||||
async function cargaPropiedades() {
|
||||
try{
|
||||
const response = await fetch($urlG+"/api/admin/busqueda/paginada?cantidadHabitaciones="+p.cantidadhabitaciones+"&tipoPropiedad="+p.tipopropiedad+"&servicios="+p.servicios+"&pag="+p.pag, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": String(token)
|
||||
}
|
||||
});
|
||||
if (response.ok) {
|
||||
let data = await response.json();
|
||||
const [response, response2] = await Promise.all([
|
||||
fetch($urlG+"/api/admin/busqueda/paginada?cantidadHabitaciones="+p.cantidadhabitaciones+"&tipoPropiedad="+p.tipopropiedad+"&servicios="+p.servicios+"&pag="+p.pag, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": String(token)
|
||||
}
|
||||
}),
|
||||
fetch($urlG+"/api/admin/busqueda/cantPag?cantidadHabitaciones="+p.cantidadhabitaciones+"&tipoPropiedad="+p.tipopropiedad+"&servicios="+p.servicios, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": String(token)
|
||||
}
|
||||
})
|
||||
]);
|
||||
|
||||
if (response.ok && response2.ok) {
|
||||
const [data, data2] = await Promise.all([response.json(),response2.json()]);
|
||||
Propiedades = data;
|
||||
cantpag = data2.message;
|
||||
return;
|
||||
}
|
||||
modaldata = "Fallo la request";
|
||||
@@ -56,31 +66,6 @@
|
||||
modaldata = "Fallo al intentar obtener la lista de propiedades";
|
||||
}
|
||||
}
|
||||
async function obtenerCant(){
|
||||
|
||||
try{
|
||||
const response = await fetch($urlG+"/api/propiedad/cantPagina?estado="+0, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": String(token)
|
||||
}
|
||||
});
|
||||
if (response.ok) {
|
||||
let data = await response.json();
|
||||
cantpag = data.message;
|
||||
return;
|
||||
}
|
||||
if (response.status === 400) {
|
||||
let data = await response.json();
|
||||
modaldata=data.message;
|
||||
return;
|
||||
}
|
||||
modaldata="Fallo al recibir la peticion de la cantidad de paginas de propiedades";
|
||||
} catch {
|
||||
modaldata="Fallo al intentar hacer la peticion de cuantas paginas hay";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function queryPag(a:number){
|
||||
p.pag = a;
|
||||
@@ -107,7 +92,7 @@
|
||||
<AdminPropiedad prop={p} modal={(a:string)=> modaldata = a} />
|
||||
<br>
|
||||
{/each}
|
||||
<PaginacionStepper currentPag={p.pag} {queryPag}/>
|
||||
<PaginacionStepper currentPag={p.pag} {queryPag} {cantpag}/>
|
||||
</div>
|
||||
<div class="col col-md-4 order-1">
|
||||
<PanelBusqueda Params={querybusc} />
|
||||
|
||||
Reference in New Issue
Block a user