AfterDataSourceResponseFunction()
AfterDataSourceResponseFunction = (
params) =>Promise<{error?:string;ok:boolean; }>
Modify response to change how data is returned after fetching 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: object[]; headers: Record<string, string>; query: Record<string, string>; requestUrl: string; }; query: any; resource: AdminForthResource; response: any; } |
params.adminforth | IAdminForth |
params.adminUser | AdminUser |
params.extra | { body: any; cookies: object[]; headers: Record<string, string>; query: Record<string, string>; requestUrl: string; } |
params.extra.body | any |
params.extra.cookies | object[] |
params.extra.headers | Record<string, string> |
params.extra.query | Record<string, string> |
params.extra.requestUrl | string |
params.query | any |
params.resource | AdminForthResource |
params.response | any |
Returns
Promise<{ error?: string; ok: boolean; }>