Apply patch [skip ci]
This commit is contained in:
parent
67cad2a3bb
commit
1b2d62ee9d
@ -85,21 +85,24 @@ export const handler = define.handlers({
|
||||
}
|
||||
|
||||
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, {
|
||||
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,
|
||||
});
|
||||
if (lease.tenant_id) {
|
||||
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, {
|
||||
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(
|
||||
JSON.stringify({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user