Fix TypeScript error in AI route
This commit is contained in:
parent
5acb2760cc
commit
b3e8b0a75f
1 changed files with 2 additions and 1 deletions
|
|
@ -26,9 +26,10 @@ export async function POST(request: Request) {
|
||||||
const intent = detectMedicalIntent(lastUserMsg);
|
const intent = detectMedicalIntent(lastUserMsg);
|
||||||
if (intent.isMedical) {
|
if (intent.isMedical) {
|
||||||
// Fetch pediatrician phone
|
// Fetch pediatrician phone
|
||||||
|
const sessionToken = request.headers.get("cookie")?.match(/tia_session=([^;]+)/)?.[1] || "";
|
||||||
const families = await sql`
|
const families = await sql`
|
||||||
SELECT pediatrician_phone FROM families
|
SELECT pediatrician_phone FROM families
|
||||||
WHERE id IN (SELECT family_id FROM family_members WHERE user_id IN (SELECT user_id FROM sessions WHERE session_token = ${request.headers.get("cookie")?.match(/tia_session=([^;]+)/)?.[1]}))
|
WHERE id IN (SELECT family_id FROM family_members WHERE user_id IN (SELECT user_id FROM sessions WHERE session_token = ${sessionToken}))
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
`;
|
`;
|
||||||
const pediatricianPhone = families[0]?.pediatrician_phone;
|
const pediatricianPhone = families[0]?.pediatrician_phone;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue