This is a generic class to provide middleware for Browse/Read/Edit/Add/Delete operations and forms. It comes with some baked-in pre-flight checks but needs to be extended to do useful work. All default actions except reads require being logged in.

Use the bakery method to create standard BREAD routes. :)

Hierarchy (View Summary)

Indexable

  • [key: string]: unknown

Constructors

Properties

action: string
actions: Record<string, BreadAction<unknown>>
editing: boolean = false
format?: string
getResourceErrorHandler: (
    messageKeyPrefix: string,
    bodyParam: string,
) => (error: unknown) => void
id?: string
isPreview: boolean = false
language?: string
messageKeyPrefix: string
method: string
next: NextFunction
renderPermissionError: BoundRenderFunction
renderResourceError: BoundRenderFunction
renderSigninRequired: BoundRenderFunction
renderTemplate: BoundTemplateRenderer
req: ProviderRequest
res: ProviderResponse

Methods