Function useDashboardData
-
useDashboardData(
client: {
addresses: (signal?: AbortSignal) => Promise<ShopUserShippingAddress[]>;
booking: (
value: string,
signal?: AbortSignal,
) => Promise<ShopBookingOrderResponse>;
bookings: (signal?: AbortSignal) => Promise<ShopBookingOrderResponse[]>;
cancelReservation: (
value: number,
) => Promise<CustomerTableReservationResponse>;
createAddress: (
body: ShopUserShippingAddressRequest,
) => Promise<ShopUserShippingAddress>;
deleteAddress: (value: string) => Promise<Record<string, string>>;
moveBooking: (
value: string,
body: ShopBookingMoveRequest,
) => Promise<unknown>;
newsletterUnsubscribe: () => Promise<Record<string, string>>;
orders: (signal?: AbortSignal) => Promise<ShopOrder[]>;
reservation: (
value: number,
signal?: AbortSignal,
) => Promise<CustomerTableReservationResponse>;
reservations: (
signal?: AbortSignal,
) => Promise<CustomerTableReservationResponse[]>;
updateAddress: (
value: string,
body: ShopUserShippingAddressRequest,
) => Promise<ShopUserShippingAddress>;
updateEmail: (body: EmailChangeRequest) => Promise<Record<string, string>>;
updatePassword: (
body: PasswordUpdateRequest,
) => Promise<Record<string, string>>;
updateProfile: (body: ShopUserProfileUpdate) => Promise<ShopUserProfile>;
updateReservation: (
value: number,
body: CustomerTableReservationUpdate,
) => Promise<CustomerTableReservationResponse>;
voucher: (
value: string,
signal?: AbortSignal,
) => Promise<ShopVoucherModel>;
voucherHistory: (
value: string,
signal?: AbortSignal,
) => Promise<ShopVoucherHistoryEntry[]>;
vouchers: (signal?: AbortSignal) => Promise<ShopVoucherModel[]>;
withdraw: (
value: string,
body: WithdrawalSelectionRequest | null,
) => Promise<CancellationRequestResult>;
withdrawalItems: (
value: string,
signal?: AbortSignal,
) => Promise<WithdrawalItemOption[]>;
},
): {
bookings: {
data: ShopBookingOrderResponse[]
| null;
error: string | null;
loading: boolean;
reload: () => void;
};
entries: AccountEntry[];
orders: {
data: ShopOrder[]
| null;
error: string | null;
loading: boolean;
reload: () => void;
};
reservations: {
data: CustomerTableReservationResponse[]
| null;
error: string | null;
loading: boolean;
reload: () => void;
};
vouchers: {
data: ShopVoucherModel[]
| null;
error: string | null;
loading: boolean;
reload: () => void;
};
}Parameters
- client: {
addresses: (signal?: AbortSignal) => Promise<ShopUserShippingAddress[]>;
booking: (
value: string,
signal?: AbortSignal,
) => Promise<ShopBookingOrderResponse>;
bookings: (signal?: AbortSignal) => Promise<ShopBookingOrderResponse[]>;
cancelReservation: (
value: number,
) => Promise<CustomerTableReservationResponse>;
createAddress: (
body: ShopUserShippingAddressRequest,
) => Promise<ShopUserShippingAddress>;
deleteAddress: (value: string) => Promise<Record<string, string>>;
moveBooking: (
value: string,
body: ShopBookingMoveRequest,
) => Promise<unknown>;
newsletterUnsubscribe: () => Promise<Record<string, string>>;
orders: (signal?: AbortSignal) => Promise<ShopOrder[]>;
reservation: (
value: number,
signal?: AbortSignal,
) => Promise<CustomerTableReservationResponse>;
reservations: (
signal?: AbortSignal,
) => Promise<CustomerTableReservationResponse[]>;
updateAddress: (
value: string,
body: ShopUserShippingAddressRequest,
) => Promise<ShopUserShippingAddress>;
updateEmail: (body: EmailChangeRequest) => Promise<Record<string, string>>;
updatePassword: (
body: PasswordUpdateRequest,
) => Promise<Record<string, string>>;
updateProfile: (body: ShopUserProfileUpdate) => Promise<ShopUserProfile>;
updateReservation: (
value: number,
body: CustomerTableReservationUpdate,
) => Promise<CustomerTableReservationResponse>;
voucher: (value: string, signal?: AbortSignal) => Promise<ShopVoucherModel>;
voucherHistory: (
value: string,
signal?: AbortSignal,
) => Promise<ShopVoucherHistoryEntry[]>;
vouchers: (signal?: AbortSignal) => Promise<ShopVoucherModel[]>;
withdraw: (
value: string,
body: WithdrawalSelectionRequest | null,
) => Promise<CancellationRequestResult>;
withdrawalItems: (
value: string,
signal?: AbortSignal,
) => Promise<WithdrawalItemOption[]>;
}Stable client instance used for API requests.
-
addresses: (signal?: AbortSignal) => Promise<ShopUserShippingAddress[]>
List customer shipping addresses.
-
booking: (value: string, signal?: AbortSignal) => Promise<ShopBookingOrderResponse>
Read one customer booking by opaque identifier.
-
bookings: (signal?: AbortSignal) => Promise<ShopBookingOrderResponse[]>
List customer event bookings. Optional signal cancels the read.
-
cancelReservation: (value: number) => Promise<CustomerTableReservationResponse>
Cancel the supplied customer reservation.
-
createAddress: (body: ShopUserShippingAddressRequest) => Promise<ShopUserShippingAddress>
Create a customer shipping address.
-
deleteAddress: (value: string) => Promise<Record<string, string>>
Delete the selected customer shipping address.
-
moveBooking: (value: string, body: ShopBookingMoveRequest) => Promise<unknown>
Reschedule a booking to the supplied backend timewindow identifier.
-
newsletterUnsubscribe: () => Promise<Record<string, string>>
Revoke newsletter consent without a request body.
-
orders: (signal?: AbortSignal) => Promise<ShopOrder[]>
List customer orders. Optional signal cancels the read.
-
reservation: (
value: number,
signal?: AbortSignal,
) => Promise<CustomerTableReservationResponse>Read a customer reservation by opaque identifier.
-
reservations: (signal?: AbortSignal) => Promise<CustomerTableReservationResponse[]>
List customer table reservations.
-
updateAddress: (
value: string,
body: ShopUserShippingAddressRequest,
) => Promise<ShopUserShippingAddress>Replace the selected customer shipping address.
-
updateEmail: (body: EmailChangeRequest) => Promise<Record<string, string>>
Request a confirmed account email change.
-
updatePassword: (body: PasswordUpdateRequest) => Promise<Record<string, string>>
Change the account password.
-
updateProfile: (body: ShopUserProfileUpdate) => Promise<ShopUserProfile>
Save changed customer profile fields.
-
updateReservation: (
value: number,
body: CustomerTableReservationUpdate,
) => Promise<CustomerTableReservationResponse>Patch only changed reservation fields.
-
voucher: (value: string, signal?: AbortSignal) => Promise<ShopVoucherModel>
Read a customer voucher by opaque identifier.
-
voucherHistory: (value: string, signal?: AbortSignal) => Promise<ShopVoucherHistoryEntry[]>
Read a customer voucher usage history.
-
vouchers: (signal?: AbortSignal) => Promise<ShopVoucherModel[]>
List customer-owned vouchers.
-
withdraw: (
value: string,
body: WithdrawalSelectionRequest | null,
) => Promise<CancellationRequestResult>Request withdrawal for selected eligible quantities.
-
withdrawalItems: (value: string, signal?: AbortSignal) => Promise<WithdrawalItemOption[]>
Read backend-authoritative withdrawal eligibility per order line.
-
Returns {
bookings: {
data: ShopBookingOrderResponse[] | null;
error: string | null;
loading: boolean;
reload: () => void;
};
entries: AccountEntry[];
orders: {
data: ShopOrder[]
| null;
error: string | null;
loading: boolean;
reload: () => void;
};
reservations: {
data: CustomerTableReservationResponse[]
| null;
error: string | null;
loading: boolean;
reload: () => void;
};
vouchers: {
data: ShopVoucherModel[]
| null;
error: string | null;
loading: boolean;
reload: () => void;
};
}-
bookings: {
data: ShopBookingOrderResponse[] | null;
error: string | null;
loading: boolean;
reload: () => void;
}List customer event bookings. Optional signal cancels the read.
-
data: ShopBookingOrderResponse[] | null
Loaded authoritative data, or null while unavailable.
-
error: string | null
Customer-visible error, or null.
-
loading: boolean
Whether the read is pending.
-
reload: () => void
Reload the resource from its authoritative API.
-
-
entries: AccountEntry[]
Entries returned by useDashboardData.
-
orders: {
data: ShopOrder[] | null;
error: string | null;
loading: boolean;
reload: () => void;
}List customer orders. Optional signal cancels the read.
-
data: ShopOrder[] | null
Loaded authoritative data, or null while unavailable.
-
error: string | null
Customer-visible error, or null.
-
loading: boolean
Whether the read is pending.
-
reload: () => void
Reload the resource from its authoritative API.
-
-
reservations: {
data: CustomerTableReservationResponse[] | null;
error: string | null;
loading: boolean;
reload: () => void;
}List customer table reservations.
-
data: CustomerTableReservationResponse[] | null
Loaded authoritative data, or null while unavailable.
-
error: string | null
Customer-visible error, or null.
-
loading: boolean
Whether the read is pending.
-
reload: () => void
Reload the resource from its authoritative API.
-
-
vouchers: {
data: ShopVoucherModel[] | null;
error: string | null;
loading: boolean;
reload: () => void;
}List customer-owned vouchers.
-
data: ShopVoucherModel[] | null
Loaded authoritative data, or null while unavailable.
-
error: string | null
Customer-visible error, or null.
-
loading: boolean
Whether the read is pending.
-
reload: () => void
Reload the resource from its authoritative API.
-
- client: {
Load dashboard orders, bookings and reservations together.