Skip to Content
⚠️Active Development Notice: TimeTiles is under active development. Information may be placeholder content or not up-to-date.

web


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?

optional reason: string

deletionStatus?

optional deletionStatus: string

deletionScheduledAt?

optional deletionScheduledAt: 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

const accountKeys: 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

ChangeEmailInput

Returns

Promise<ChangeEmailResponse>


changePasswordRequest()

changePasswordRequest(input): Promise<ChangePasswordResponse>

Change the current user’s password via /api/users/change-password.

Parameters

input

ChangePasswordInput

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>

Last updated on