antes de implementar el minio
This commit is contained in:
@@ -6,12 +6,10 @@
|
||||
import { urlG } from "../stores/urlStore";
|
||||
import ModalConfirm from "../Componentes/ModalConfirm.svelte";
|
||||
import BarraHorizontalConTexto from "../Componentes/BarraHorizontalConTexto.svelte";
|
||||
import { text } from "@sveltejs/kit";
|
||||
import ModalPrecontrato from "../Componentes/ModalPrecontrato.svelte";
|
||||
import { get } from "svelte/store";
|
||||
import ModalAddGarantes from "../Componentes/ModalAddGarantes.svelte";
|
||||
import { Accordion } from "@sveltestrap/sveltestrap";
|
||||
import ModalCheckYContrato from "../Componentes/ModalCheckYContrato.svelte";
|
||||
import { self } from "svelte/legacy";
|
||||
|
||||
const token = sessionStorage.getItem("token");
|
||||
let mensajes: MensajeDto[] = $state([]);
|
||||
@@ -125,6 +123,30 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function obtenerListaGarantes(idcontrato: number) {
|
||||
if (Selmens.accion !== "Check y Contrato") return;
|
||||
try {
|
||||
const responce = await fetch($urlG+"/api/contratos/precontrato/listaGarantes?idcontrato="+idcontrato+"&EmailPropietario="+sessionStorage.getItem("email"), {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": String(token),
|
||||
},
|
||||
});
|
||||
|
||||
if (responce.ok) {
|
||||
let data = await responce.json();
|
||||
garantes = data;
|
||||
return;
|
||||
}
|
||||
let data = await responce.json();
|
||||
Selmens.accion="";
|
||||
modaldata = data.message;
|
||||
} catch {
|
||||
Selmens.accion="";
|
||||
modaldata="No se pudo Obtener la lista de garantes";
|
||||
}
|
||||
}
|
||||
|
||||
async function handleEnviarmensaje2(data: {opcionVenta:boolean, cantGarantes:number, mesesHastaAumento:number}) {
|
||||
if (data.opcionVenta == null || data.cantGarantes <=0 || data.mesesHastaAumento<=0) {
|
||||
modaldata = "Estan mal cargados los datos del form";
|
||||
@@ -205,8 +227,40 @@
|
||||
}
|
||||
}
|
||||
|
||||
function handleCancelPrecontrato(): void {
|
||||
|
||||
async function handleCancelPrecontrato() {
|
||||
if (Selmens.accion !== "Check y Contrato") return;
|
||||
try {
|
||||
let data = {
|
||||
emailPropietario: Selmens.receptor,
|
||||
emailInquilino: Selmens.remitente,
|
||||
fecha: Selmens.fecha,
|
||||
idpropiedad: Selmens.propiedad,
|
||||
}
|
||||
let responce = await fetch($urlG+"/api/contratos/cancelar", {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Auth": String(token),
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
})
|
||||
|
||||
if (responce.ok){
|
||||
let dataa = await responce.json();
|
||||
modaldata = dataa.message;
|
||||
if (mostrarleidos) {
|
||||
Leidos();
|
||||
} else {
|
||||
SinLeer();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
let dataa = await responce.json();
|
||||
modaldata = dataa.message;
|
||||
return
|
||||
}catch {
|
||||
modaldata = "fallo al intentar conectar con el servidor";
|
||||
}
|
||||
}
|
||||
|
||||
async function handleEnviarmensaje4() {
|
||||
|
||||
Reference in New Issue
Block a user