ReferenceReact
useDeleteRecord
Delete a record (soft delete — moves it to the trash). The collection transaction is the single optimistic mechanism: `deletedAt` is stamped on the entity synchronously and auto-rolled back if the server rejects. The archived/detail RQ caches refresh by invalidation on success — no cache surgery, no snapshot.
Delete a record (soft delete — moves it to the trash).
The collection transaction is the single optimistic mechanism: deletedAt is
stamped on the entity synchronously and auto-rolled back if the server
rejects. The archived/detail RQ caches refresh by invalidation on success —
no cache surgery, no snapshot.
Signature
(objectName: string, options?: UseDeleteRecordOptions | undefined): UseMutationResult<void, Error, string>Examples
```tsx
const { mutate: deleteProduct, isPending } = useDeleteRecord("products");
deleteProduct("rec-123");