diff --git a/app/api/data/route.ts b/app/api/data/route.ts index 80cf00d..e8e45e8 100644 --- a/app/api/data/route.ts +++ b/app/api/data/route.ts @@ -124,7 +124,7 @@ export async function GET(req: NextRequest) { select: ["contact_id_b"], where: [ ["contact_id_a", "=", Number(cid)], - ["relationship_type_id:name_a_b", "=", FORM_CONTACT_RELATIONSHIP], + ["relationship_type_id.name_a_b", "=", FORM_CONTACT_RELATIONSHIP], ["is_active", "=", true], ], limit: 2, diff --git a/app/api/health/route.ts b/app/api/health/route.ts index 82c07df..756e22b 100644 --- a/app/api/health/route.ts +++ b/app/api/health/route.ts @@ -295,16 +295,16 @@ async function probeContactRelationships(cid: string): Promise { id: number; contact_id_a: number; contact_id_b: number; - "relationship_type_id:name_a_b": string; - "relationship_type_id:name_b_a": string; + "relationship_type_id.name_a_b": string; + "relationship_type_id.name_b_a": string; is_active: boolean; }>("Relationship", "get", { select: [ "id", "contact_id_a", "contact_id_b", - "relationship_type_id:name_a_b", - "relationship_type_id:name_b_a", + "relationship_type_id.name_a_b", + "relationship_type_id.name_b_a", "is_active", ], where: [ @@ -324,12 +324,12 @@ async function probeContactRelationships(cid: string): Promise { const lines = rows.map((r) => { const sideA = String(r.contact_id_a) === cid ? "★A" : "·A"; const sideB = String(r.contact_id_b) === cid ? "★B" : "·B"; - return ` ${sideA}=${r.contact_id_a} ${sideB}=${r.contact_id_b} type="${r["relationship_type_id:name_a_b"]}" / inverse="${r["relationship_type_id:name_b_a"]}"`; + return ` ${sideA}=${r.contact_id_a} ${sideB}=${r.contact_id_b} type="${r["relationship_type_id.name_a_b"]}" / inverse="${r["relationship_type_id.name_b_a"]}"`; }); const usable = rows.find( (r) => String(r.contact_id_a) === cid && - r["relationship_type_id:name_a_b"] === FORM_CONTACT_RELATIONSHIP, + r["relationship_type_id.name_a_b"] === FORM_CONTACT_RELATIONSHIP, ); return { check: "contact_relationships_dump", diff --git a/app/api/submit/route.ts b/app/api/submit/route.ts index 8b5d347..b21d78d 100644 --- a/app/api/submit/route.ts +++ b/app/api/submit/route.ts @@ -54,7 +54,7 @@ export async function POST(req: Request) { select: ["contact_id_b"], where: [ ["contact_id_a", "=", Number(cid)], - ["relationship_type_id:name_a_b", "=", FORM_CONTACT_RELATIONSHIP], + ["relationship_type_id.name_a_b", "=", FORM_CONTACT_RELATIONSHIP], ["is_active", "=", true], ], limit: 2,