Sign Up
Loading...

Relating Leads and Appointments across tables

Asked by Benjie on April 30, 2024

Given two models — Leads (primary user_id) and Appointments (primary appt_id) — how can I query leads by user_id and return appointment details and vice‑versa?


Answered by Twidget

Add a user_id field to the Appointment table, then create an endpoint that accepts user_id as a path or query parameter and uses it to query the Appointment table to return related appointment details.

Related Questions