Skip to content

onAfterShow()

This hook/event is called the after the fetching an item by id.

It can be used in the SHOW handler.

ts
import { IAfterShowContext } from "axe-api";

export default async (parameters: IAfterShowContext) => {
  // do something in here
};

IAfterShowContext

The following parameters can be used in the hook/event function;

ParameterDescription
reqAxeRequest
resAxeResponse
modelCurrent model instance. For example; User
databaseDatabase connection instance. For example Knex.js
relationThe relation definition if the route is a related route (For example api/v1/users/:userId/posts).
parentModelThe parent model instance if the route is a related route (For example api/v1/users/:userId/posts).
queryThe Knex.js' query instance.
conditionsThe conditions which has been send by the HTTP client to filter data.
itemThe current record.

Released under the MIT License.