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