destroy

Description
POST - Destroying an entity row

Methods


start( data )

Description
Called to delete an entity row in database
Parameters
Name Type Description
data object
Name Type Attributes Description
req object Request - See expressjs definition
res object Response - See expressjs definition
transaction object <optional>
Database transaction. undefined by default, provide your own when necessary
idEntity string Id of entity to delete

beforeEntityQuery( data )

Description
Called before fetching row to delete
Parameters
Name Type Description
data object
Name Type Attributes Description
req object Request - See expressjs definition
res object Response - See expressjs definition
transaction object <optional>
Database transaction. undefined by default, provide your own when necessary
idEntity string Id of entity to delete

beforeEntityQuery( data )

Description
Called before deleting row in database
Parameters
Name Type Description
data object
Name Type Attributes Description
req object Request - See expressjs definition
res object Response - See expressjs definition
transaction object <optional>
Database transaction. undefined by default, provide your own when necessary
idEntity string Id of entity to delete
deleteObject object Instance of entity to delete

beforeEntityQuery( data )

Description
Called before redirecting to `data.redirect`
Parameters
Name Type Description
data object
Name Type Attributes Description
req object Request - See expressjs definition
res object Response - See expressjs definition
transaction object <optional>
Database transaction. undefined by default, provide your own when necessary
idEntity string Id of entity to delete
deleteObject object Instance of entity to delete
redirect string Where to redirect the response