BeforeDataSourceRequestFunction()
BeforeDataSourceRequestFunction: (
params) =>Promise<object>
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
| Parameter | Type |
|---|---|
params | object |
params.adminUser | AdminUser |
params.adminforth | IAdminForth |
params.extra | object |
params.extra.body | any |
params.extra.cookies | Record<string, string> |
params.extra.headers | Record<string, string> |
params.extra.query | Record<string, string> |
params.extra.requestUrl | string |
params.query | any |
params.resource | AdminForthResource |
Returns
Promise<object>
error?
optionalerror:string
newRecordId?
optionalnewRecordId:string
ok
ok:
boolean