website refactor
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* 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 };
|
||||
Reference in New Issue
Block a user