Groups
5 min read
Organizing Contacts into Groups
Organizing Contacts into Groups
A contact can belong to more than one group (Work, Family, Book Club), and
a group can have many contacts — a classic many-to-many relationship,
which in a relational database means a third join table sitting
between the two.
This module covers:
- Adding
groupsandcontact_groupstables to the schema - A
lib/groups.tsdata module, and the Groups page (list + create) - The group detail page, reusing
getContactswith one more filter - Linking groups to contacts: checkboxes in the form, group chips on the
detail page, and keeping the join table in sync every time a contact is
saved
It’s the longest module in the course, but every piece builds directly on
patterns from Modules 2, 3, and 5.