Apply patch [skip ci]
This commit is contained in:
parent
3a63942bfd
commit
883a5a5186
@ -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) {
|
||||
return new Response(JSON.stringify({ error: "lease_id is required" }), {
|
||||
status: 400,
|
||||
@ -36,10 +37,13 @@ export const handler = define.handlers({
|
||||
}
|
||||
|
||||
const result = await signLease(lease_id, user_id as string);
|
||||
return new Response(JSON.stringify({ success: true, lease: result?.[0] || null }), {
|
||||
status: 200,
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
return new Response(
|
||||
JSON.stringify({ success: true, lease: result?.[0] || null }),
|
||||
{
|
||||
status: 200,
|
||||
headers: { "Content-Type": "application/json" },
|
||||
},
|
||||
);
|
||||
} catch (err) {
|
||||
return new Response(JSON.stringify({ error: String(err) }), {
|
||||
status: 500,
|
||||
@ -48,4 +52,3 @@ export const handler = define.handlers({
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -247,6 +247,3 @@ export async function getLeaseStatsByOwner(owner_id: string) {
|
||||
without_tenant: allLeases.filter((l) => l.tenant_id === null).length,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user