- Backend: the church profile from Accounts (src/accounts/church.ts, kept 10 minutes, last copy kept while Accounts is down), public GET /api/v2/church, and church.changed accepted at POST /api/church/v1/changed (signed with the Accounts link; it answered 404 before). - Frontend: brandAttributes on <html>, @crosscode/ui/fonts.css, body and h1-h3 use the church's pairing, --radius follows its corners; the dashboard and setup screens (data-cc-staff) keep their fonts and 0.5rem. - The shared ChurchFooter on public pages when Accounts is connected (terms and cookie settings below it); header links to the church's other sites. - @crosscode/ui 0.3.0: ChurchFooter takes `bottom`. - Tests: tests/churchProfile.test.ts (8); e2e/church-brand.spec.ts and a /test/profile hook on the e2e Accounts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
1.0 KiB
TypeScript
24 lines
1.0 KiB
TypeScript
import { churchSchema } from '@crosscode/contracts';
|
|
import { defineRoute } from '../route';
|
|
import { single } from '../paging';
|
|
import { churchProfile } from '../../accounts/church';
|
|
|
|
/**
|
|
* The church profile for the public pages (3.7.0, docs/WEBSITE-1.0-PLAN.md §9): its brand style
|
|
* (fonts, corners) and the shared footer's details, from the church's Accounts
|
|
* (src/accounts/church.ts). null when Accounts isn't connected.
|
|
*/
|
|
export const getChurch = defineRoute({
|
|
method: 'get',
|
|
path: '/church',
|
|
tag: 'Site',
|
|
summary: "The church's profile",
|
|
description: "The church profile (crosscode.church/1) from the church's Accounts: name, logo, brand style, service times, contact details, social links and its other sites. null when sign-in doesn't go through Accounts yet. Kept for up to 10 minutes, or until Accounts says it changed.",
|
|
access: 'public',
|
|
response: single(churchSchema.nullable()),
|
|
async handler({ res }) {
|
|
res.setHeader('Cache-Control', 'public, max-age=60');
|
|
return { data: await churchProfile() };
|
|
},
|
|
});
|