Apply patch [skip ci]

This commit is contained in:
open-swe-dev-andrinoid[bot] 2026-01-22 05:50:47 +00:00
parent 3a63942bfd
commit 883a5a5186
2 changed files with 9 additions and 9 deletions

View File

@ -27,7 +27,8 @@ export const handler = define.handlers({
} }
} }
const lease_id = (data.lease_id as string) || (data["lease_id"] as string); const lease_id = (data.lease_id as string) ||
(data["lease_id"] as string);
if (!lease_id) { if (!lease_id) {
return new Response(JSON.stringify({ error: "lease_id is required" }), { return new Response(JSON.stringify({ error: "lease_id is required" }), {
status: 400, status: 400,
@ -36,10 +37,13 @@ export const handler = define.handlers({
} }
const result = await signLease(lease_id, user_id as string); const result = await signLease(lease_id, user_id as string);
return new Response(JSON.stringify({ success: true, lease: result?.[0] || null }), { return new Response(
status: 200, JSON.stringify({ success: true, lease: result?.[0] || null }),
headers: { "Content-Type": "application/json" }, {
}); status: 200,
headers: { "Content-Type": "application/json" },
},
);
} catch (err) { } catch (err) {
return new Response(JSON.stringify({ error: String(err) }), { return new Response(JSON.stringify({ error: String(err) }), {
status: 500, status: 500,
@ -48,4 +52,3 @@ export const handler = define.handlers({
} }
}, },
}); });

View File

@ -247,6 +247,3 @@ export async function getLeaseStatsByOwner(owner_id: string) {
without_tenant: allLeases.filter((l) => l.tenant_id === null).length, without_tenant: allLeases.filter((l) => l.tenant_id === null).length,
}; };
} }