Apply patch [skip ci]

This commit is contained in:
open-swe-dev-andrinoid[bot] 2026-01-29 19:09:09 +00:00 committed by Nathan Anderson
parent 67cad2a3bb
commit 1b2d62ee9d

View File

@ -85,21 +85,24 @@ export const handler = define.handlers({
} }
const rejectedLease = result[0]; const rejectedLease = result[0];
const tenant = await getUserById(lease.tenant_id);
const landlord = await getUserById(user_id);
const property = lease.property_id
? await getPropertyById(lease.property_id)
: null;
await sendLeaseRejected(lease.tenant_id, { if (lease.tenant_id) {
lease_id: lease.id, const tenant = await getUserById(lease.tenant_id);
property_address: property?.address_1 const landlord = await getUserById(user_id);
? `${property.address_1}, ${property.city}, ${property.state}` const property = lease.property_id
: lease.property_address || "Property", ? await getPropertyById(lease.property_id)
tenant_name: tenant?.name || "Tenant", : null;
landlord_name: landlord?.name || "Landlord",
monthly_rent: property?.monthly_rent || lease.rent, await sendLeaseRejected(lease.tenant_id, {
}); lease_id: lease.id,
property_address: property?.address_1
? `${property.address_1}, ${property.city}, ${property.state}`
: lease.property_address || "Property",
tenant_name: tenant?.name || "Tenant",
landlord_name: landlord?.name || "Landlord",
monthly_rent: property?.monthly_rent || lease.rent,
});
}
return new Response( return new Response(
JSON.stringify({ JSON.stringify({