Skip to main content
Version: 1.0.0

Function: deleteEntityWithCallbacks

deleteEntityWithCallbacks<M, UserType>(__namedParameters): Promise<boolean>

This function is in charge of deleting an entity in the datasource. It will run all the delete callbacks specified in the schema. It is also possible to attach callbacks on save success or error, and callback errors.

If you just want to delete the data without running the onPreDelete, and onDelete callbacks, you can use the deleteEntity method in the datasource (useDataSource).

Type parameters

Name
M
UserType

Parameters

NameType
__namedParametersDeleteEntityProps<M> & { callbacks?: EntityCallbacks<M> ; onDeleteFailure?: (entity: Entity<M>, e: Error) => void ; onDeleteSuccess?: (entity: Entity<M>) => void ; onDeleteSuccessHookError?: (entity: Entity<M>, e: Error) => void ; onPreDeleteHookError?: (entity: Entity<M>, e: Error) => void } & { context: FireCMSContext<UserType> ; dataSource: DataSource ; schema: ResolvedEntitySchema<M> }

Returns

Promise<boolean>

Defined in

hooks/data/delete.ts:45

Enterprise or start-up?

Learn how to get the most out of your project with the help of our consulting team.
Learn more
Sign up to our newsletter to get the latest news and updates. No spam!