Skip to main content
Version: 2.0.0-alpha

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 collection. It is also possible to attach callbacks on save success or error, and callback errors.

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

Type parameters

Mextends Record<string, any>
UserTypeextends User


__namedParametersDeleteEntityProps<M> & { callbacks?: EntityCallbacks<M, User> ; 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 } & { collection: ResolvedEntityCollection<M> ; context: FireCMSContext<UserType, AuthController<UserType>> ; dataSource: DataSource }



Defined in


Need a hand?

We are happy to offer consulting services to help you get the most out of FireCMS.
Get in touch