Regions: featured cards in the region list and on the region's page (migration 072)
A region owns featured cards like the front page does, set in its editor (shown when Kind is region). They show in its row of the region list when opened, and in a Featured section on its page. featured_cards takes an 'organization' owner kind; the table is rebuilt, and a region's cards go when it does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
07be48d770
commit
2977168af5
9 changed files with 181 additions and 17 deletions
|
|
@ -56,6 +56,7 @@ import {
|
|||
asBool,
|
||||
json,
|
||||
loadBlocks,
|
||||
loadFeaturedCardsFor,
|
||||
loadLinks,
|
||||
loadOwned,
|
||||
marks,
|
||||
|
|
@ -286,6 +287,9 @@ function attachRegionDetails(db, orgs) {
|
|||
)
|
||||
.all(...ids);
|
||||
|
||||
// Its own featured cards (072), for its row and its page.
|
||||
const featuredBy = loadFeaturedCardsFor(db, "organization", ids);
|
||||
|
||||
const byId = Object.fromEntries(rows.map((r) => [r.id, r]));
|
||||
const areasBy = new Map();
|
||||
const childrenBy = new Map();
|
||||
|
|
@ -321,6 +325,7 @@ function attachRegionDetails(db, orgs) {
|
|||
map_note: byId[org.id]?.map_note ?? null,
|
||||
areas: areasBy.get(org.id) ?? [],
|
||||
groups: childrenBy.get(org.id) ?? [],
|
||||
featured: featuredBy.get(org.id) ?? [],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue