[ Web Proxy ]
URL:
Viewing: https://adminforth.dev/docs/api/Back/type-aliases/BeforeDataSourceRequestFunction/ [Back]  [Original]

BeforeDataSourceRequestFunction | Agent-first open-source admin panel framework
Skip to main content
On this page

BeforeDataSourceRequestFunction

BeforeDataSourceRequestFunction = (params) => Promise<{ error?: string | null; ok: boolean; redirectToRecordId?: string; }>

Modify query to change how data is fetched from database. Return ok: false and error: string to stop execution and show error message to user. Return ok: true to continue execution.

Parameters

ParameterType
params{ adminforth: IAdminForth; adminUser: AdminUser; extra: { body: any; cookies: object[]; headers: Record<string, string>; query: Record<string, string>; requestUrl: string; }; filtersTools: any; query: any; resource: AdminForthResource; }
params.adminforthIAdminForth
params.adminUserAdminUser
params.extra{ body: any; cookies: object[]; headers: Record<string, string>; query: Record<string, string>; requestUrl: string; }
params.extra.bodyany
params.extra.cookiesobject[]
params.extra.headersRecord<string, string>
params.extra.queryRecord<string, string>
params.extra.requestUrlstring
params.filtersToolsany
params.queryany
params.resourceAdminForthResource

Returns

Promise<{ error?: string | null; ok: boolean; redirectToRecordId?: string; }>

Previous
BeforeCreateSaveFunction
Next
BeforeDeleteSaveFunction

Web Proxy Viewer  |  New URL  |  Original Page