Skip to main content

Function: useDeleteEprint()

useDeleteEprint(): UseMutationResult<OutputSchema, APIError, DeleteEprintParams, unknown>

Defined in: web/lib/hooks/use-eprint-mutations.ts:125

Mutation hook for deleting eprints.

Returns​

UseMutationResult<OutputSchema, APIError, DeleteEprintParams, unknown>

TanStack Query mutation object with mutate, isPending, and error states

Remarks​

Validates authorization via the backend. On success, invalidates relevant queries. The actual PDS deletion should be performed by the frontend using the ATProto client.

Example​

const { mutate: deleteEprint, isPending } = useDeleteEprint();

const handleDelete = async () => {
try {
await deleteEprint({ uri: eprint.uri });
// Now make the actual PDS call
await atprotoAgent.deleteRecord(eprint.uri);
toast.success('Eprint deleted');
} catch (error) {
toast.error('Failed to delete eprint');
}
};