Files
gridpilot.gg/apps/website/lib/contracts/page-queries/PageQueryResult.ts
2026-01-12 19:24:59 +01:00

18 lines
483 B
TypeScript

/**
* PageQueryResult discriminated union
*
* Canonical result type for all server-side page queries.
* Defines the explicit outcome of a page query execution.
*
* Based on WEBSITE_PAGE_QUERIES.md:
* - ok with { dto }
* - notFound
* - redirect with { to }
* - error with { errorId }
*/
export type PageQueryResult<TPageDto> =
| { status: 'ok'; dto: TPageDto }
| { status: 'notFound' }
| { status: 'redirect'; to: string }
| { status: 'error'; errorId: string };