Apply patch [skip ci]

This commit is contained in:
open-swe-dev-andrinoid[bot] 2026-01-29 19:11:06 +00:00 committed by Nathan Anderson
parent 5d9398b2d2
commit 776f22ce62
3 changed files with 9 additions and 10 deletions

View File

@ -4,9 +4,7 @@ import { SessionCookie } from "../../auth/callback.ts";
import { approveLease, getLeaseById } from "../../../services/leaseService.ts"; import { approveLease, getLeaseById } from "../../../services/leaseService.ts";
import { getUserById } from "../../../services/userService.ts"; import { getUserById } from "../../../services/userService.ts";
import { getPropertyById } from "../../../services/propertyService.ts"; import { getPropertyById } from "../../../services/propertyService.ts";
import { import { sendLeaseApproved } from "../../../services/notificationService.ts";
sendLeaseApproved,
} from "../../../services/notificationService.ts";
export const handler = define.handlers({ export const handler = define.handlers({
async POST(ctx) { async POST(ctx) {
@ -83,7 +81,7 @@ export const handler = define.handlers({
} }
const approvedLease = result[0]; const approvedLease = result[0];
if (lease.tenant_id) { if (lease.tenant_id) {
const tenant = await getUserById(lease.tenant_id); const tenant = await getUserById(lease.tenant_id);
const landlord = await getUserById(user_id); const landlord = await getUserById(user_id);

View File

@ -1,12 +1,10 @@
// routes/api/lease/reject.ts // routes/api/lease/reject.ts
import { define } from "../../../utils.ts"; import { define } from "../../../utils.ts";
import { SessionCookie } from "../../auth/callback.ts"; import { SessionCookie } from "../../auth/callback.ts";
import { rejectLease, getLeaseById } from "../../../services/leaseService.ts"; import { getLeaseById, rejectLease } from "../../../services/leaseService.ts";
import { getUserById } from "../../../services/userService.ts"; import { getUserById } from "../../../services/userService.ts";
import { getPropertyById } from "../../../services/propertyService.ts"; import { getPropertyById } from "../../../services/propertyService.ts";
import { import { sendLeaseRejected } from "../../../services/notificationService.ts";
sendLeaseRejected,
} from "../../../services/notificationService.ts";
export const handler = define.handlers({ export const handler = define.handlers({
async POST(ctx) { async POST(ctx) {
@ -85,7 +83,7 @@ export const handler = define.handlers({
} }
const rejectedLease = result[0]; const rejectedLease = result[0];
if (lease.tenant_id) { if (lease.tenant_id) {
const tenant = await getUserById(lease.tenant_id); const tenant = await getUserById(lease.tenant_id);
const landlord = await getUserById(user_id); const landlord = await getUserById(user_id);

View File

@ -1,7 +1,10 @@
// routes/api/lease/request-approval.ts // routes/api/lease/request-approval.ts
import { define } from "../../../utils.ts"; import { define } from "../../../utils.ts";
import { SessionCookie } from "../../auth/callback.ts"; import { SessionCookie } from "../../auth/callback.ts";
import { requestLeaseApproval } from "../../../services/leaseService.ts"; import {
getLeaseById,
requestLeaseApproval,
} from "../../../services/leaseService.ts";
import { import {
getTenantInviteById, getTenantInviteById,
updateTenantInvite, updateTenantInvite,