web / lib/hooks/use-account-mutations
lib/hooks/use-account-mutations
React Query hooks for account management operations.
Provides typed mutations for changing email/password, fetching the deletion summary, and scheduling account deletion.
Interfaces
ChangeEmailInput
Input for the change-email mutation.
Properties
newEmail
newEmail:
string
password
password:
string
ChangePasswordInput
Input for the change-password mutation.
Properties
currentPassword
currentPassword:
string
newPassword
newPassword:
string
DeletionSummaryResponse
Response from /api/account/deletion-summary.
Properties
summary
summary:
DeletionSummary
canDelete
canDelete:
boolean
reason?
optionalreason:string
deletionStatus?
optionaldeletionStatus:string
deletionScheduledAt?
optionaldeletionScheduledAt:string
ScheduleDeletionInput
Input for the schedule-deletion mutation.
Properties
password
password:
string
ScheduleDeletionResponse
Response from /api/users/schedule-deletion.
Properties
message
message:
string
deletionScheduledAt
deletionScheduledAt:
string
summary
summary:
DeletionSummary
Variables
accountKeys
constaccountKeys:object
Type Declaration
all
all: readonly [
"account"]
deletionSummary()
deletionSummary: () => readonly [
"account","deletion-summary"]
Returns
readonly ["account", "deletion-summary"]
Functions
useDeletionSummaryQuery()
useDeletionSummaryQuery(
options?):UseQueryResult<DeletionSummaryResponse,Error>
Fetch the deletion summary for the current user.
Disabled by default — callers opt in via enabled.
Parameters
options?
enabled?
boolean
Returns
UseQueryResult<DeletionSummaryResponse, Error>
changeEmailRequest()
changeEmailRequest(
input):Promise<ChangeEmailResponse>
Change the current user’s email via /api/users/change-email.
Parameters
input
Returns
Promise<ChangeEmailResponse>
changePasswordRequest()
changePasswordRequest(
input):Promise<ChangePasswordResponse>
Change the current user’s password via /api/users/change-password.
Parameters
input
Returns
Promise<ChangePasswordResponse>
useCancelDeletionMutation()
useCancelDeletionMutation():
UseMutationResult<void,Error,void,unknown>
Cancel a pending account deletion via /api/users/cancel-deletion.
Returns
UseMutationResult<void, Error, void, unknown>
useScheduleDeletionMutation()
useScheduleDeletionMutation():
UseMutationResult<ScheduleDeletionResponse,Error,ScheduleDeletionInput,unknown>
Schedule account deletion via /api/users/schedule-deletion.
Returns
UseMutationResult<ScheduleDeletionResponse, Error, ScheduleDeletionInput, unknown>