Organization cards: list partners, ministries or a hand-picked set (migration 067)
The Partners section's preset gets "Cards: list" (partners by default, ministries, or both) and an optional hand-picked list (page_section_orgs, partners or ministries only, enforced by trigger) that replaces it in its own order. /organizations takes kind=ministry and ids=; the plain list still leaves ministries out. Ministry cards link to their website only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
635dd21083
commit
fd7e1b6fc1
11 changed files with 146 additions and 23 deletions
|
|
@ -27,10 +27,13 @@ import { isBadId, orgHref } from "./hrefs.ts";
|
|||
import { useResource } from "./useResource.ts";
|
||||
|
||||
|
||||
export function useOrganizations(kind) {
|
||||
const path = kind
|
||||
? `/organizations?kind=${encodeURIComponent(kind)}`
|
||||
: "/organizations";
|
||||
/* `ids` (a hand-picked list) wins over `kind`. */
|
||||
export function useOrganizations(kind, ids?: string[]) {
|
||||
const path = ids?.length
|
||||
? `/organizations?ids=${ids.map(encodeURIComponent).join(",")}`
|
||||
: kind
|
||||
? `/organizations?kind=${encodeURIComponent(kind)}`
|
||||
: "/organizations";
|
||||
|
||||
const { data, error, loading } = useResource(path);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue