onAfterSearch()
This hook/event is called the after fetching search results.
It can be used in the SEARCG
handler.
ts
import { IAfterSearchContext } from "axe-api";
export default async (parameters: IAfterSearchContext) => {
// do something in here
};
IAfterSearchContext
The following parameters can be used in the hook/event function;
Parameter | Description |
---|---|
req | AxeRequest |
res | AxeResponse |
model | Current model instance. For example; User |
database | Database connection instance. For example Knex.js |
relation | The relation definition if the route is a related route (For example api/v1/users/:userId/posts ). |
parentModel | The parent model instance if the route is a related route (For example api/v1/users/:userId/posts ). |
query | The Knex.js' query instance. |
conditions | The conditions which has been send by the HTTP client to filter data. |
result | The query result. |