Skip to content
On this page

onBeforeForceDelete()

This hook/event is called the before deleting a record.

It can be used in the FORCE_DELETE handler.

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

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

IHookParameters

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

ParameterDescription
requestRequest object of Expresss
responseResponse object of Expresss
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.

Released under the MIT License.