diff --git a/frontend/src/components/routes/event/HomepageDesigner/index.tsx b/frontend/src/components/routes/event/HomepageDesigner/index.tsx
index e1b25fc9..8192c65a 100644
--- a/frontend/src/components/routes/event/HomepageDesigner/index.tsx
+++ b/frontend/src/components/routes/event/HomepageDesigner/index.tsx
@@ -90,7 +90,7 @@ const HomepageDesigner = () => {
{t`Colors`}
@@ -197,7 +197,7 @@ export const ManageProfile = () => {
required
{...passwordForm.getInputProps('password_confirmation')}
label={t`Confirm New Password`}/>
-
diff --git a/frontend/src/components/routes/ticket-widget/CollectInformation/index.tsx b/frontend/src/components/routes/ticket-widget/CollectInformation/index.tsx
index 57729667..720c250c 100644
--- a/frontend/src/components/routes/ticket-widget/CollectInformation/index.tsx
+++ b/frontend/src/components/routes/ticket-widget/CollectInformation/index.tsx
@@ -88,29 +88,29 @@ export const CollectInformation = () => {
});
}
- const mutation = useMutation(
- (orderData: FinaliseOrderPayload) => orderClientPublic.finaliseOrder(Number(eventId), String(orderShortId), orderData),
- {
- onSuccess: (data) => {
- const nextPage = order?.is_payment_required ? 'payment' : 'summary';
- navigate(eventCheckoutPath(eventId, data.data.short_id, nextPage));
- },
- onError: (error: any) => {
- if (error?.response?.data?.errors && Object.keys(error?.response?.data?.errors).length > 0) {
- form.setErrors(error.response.data.errors);
- } else if (error?.response?.data?.message) {
- notifications.show({
- message: error?.response?.data?.message,
- });
-
- // if it's a 409, we need to redirect to the event page as the order is no longer valid
- if (error.response.status === 409) {
- navigate(eventHomepagePath(event as Event));
- }
+ const mutation = useMutation({
+ mutationFn: (orderData: FinaliseOrderPayload) => orderClientPublic.finaliseOrder(Number(eventId), String(orderShortId), orderData),
+
+ onSuccess: (data) => {
+ const nextPage = order?.is_payment_required ? 'payment' : 'summary';
+ navigate(eventCheckoutPath(eventId, data.data.short_id, nextPage));
+ },
+
+ onError: (error: any) => {
+ if (error?.response?.data?.errors && Object.keys(error?.response?.data?.errors).length > 0) {
+ form.setErrors(error.response.data.errors);
+ } else if (error?.response?.data?.message) {
+ notifications.show({
+ message: error?.response?.data?.message,
+ });
+
+ // if it's a 409, we need to redirect to the event page as the order is no longer valid
+ if (error.response.status === 409) {
+ navigate(eventHomepagePath(event as Event));
}
- },
+ }
}
- );
+ });
const createTicketIdToQuestionMap = () => {
const ticketIdToQuestionMap = new Map();
@@ -330,7 +330,7 @@ export const CollectInformation = () => {
)}
{
);
}
-export default CollectInformation;
\ No newline at end of file
+export default CollectInformation;
diff --git a/frontend/src/components/routes/ticket-widget/SelectTickets/index.tsx b/frontend/src/components/routes/ticket-widget/SelectTickets/index.tsx
index d4735a81..a41f0114 100644
--- a/frontend/src/components/routes/ticket-widget/SelectTickets/index.tsx
+++ b/frontend/src/components/routes/ticket-widget/SelectTickets/index.tsx
@@ -81,32 +81,32 @@ const SelectTickets = (props: SelectTicketsProps) => {
});
//todo - replace with hook
- const ticketMutation = useMutation(
- (orderData: TicketFormPayload) => orderClientPublic.create(Number(eventId), orderData),
- {
- onSuccess: (data) => queryClient.invalidateQueries()
- .then(() => {
- const url = '/checkout/' + eventId + '/' + data.data.short_id + '/details';
- if (props.widgetMode === 'embedded') {
- window.open(url, '_blank');
- setOrderInProcessOverlayVisible(true);
- return;
- }
-
- return navigate(url);
- }),
- onError: (error: any) => {
- if (error?.response?.data?.errors) {
- form.setErrors(error.response.data.errors);
+ const ticketMutation = useMutation({
+ mutationFn: (orderData: TicketFormPayload) => orderClientPublic.create(Number(eventId), orderData),
+
+ onSuccess: (data) => queryClient.invalidateQueries()
+ .then(() => {
+ const url = '/checkout/' + eventId + '/' + data.data.short_id + '/details';
+ if (props.widgetMode === 'embedded') {
+ window.open(url, '_blank');
+ setOrderInProcessOverlayVisible(true);
+ return;
}
- notifications.show({
- message: error.response.data.errors?.tickets[0] || t`Unable to create ticket. Please check the your details`,
- color: 'red',
- });
- },
+ return navigate(url);
+ }),
+
+ onError: (error: any) => {
+ if (error?.response?.data?.errors) {
+ form.setErrors(error.response.data.errors);
+ }
+
+ notifications.show({
+ message: error.response.data.errors?.tickets[0] || t`Unable to create ticket. Please check the your details`,
+ color: 'red',
+ });
}
- );
+ });
const promoCodeEventRefetchMutation = useMutation({
mutationFn: async (promoCode: string | null) => {
@@ -226,14 +226,14 @@ const SelectTickets = (props: SelectTicketsProps) => {
}
}
- const isButtonDisabled = ticketMutation.isLoading
+ const isButtonDisabled = ticketMutation.isPending
|| !ticketAreAvailable
|| selectedTicketQuantitySum === 0
|| props.widgetMode === 'preview'
|| tickets?.every(ticket => ticket.is_sold_out);
return (
- {
)}
-
{orderInProcessOverlayVisible && (
setOrderInProcessOverlayVisible(false)}>
@@ -278,7 +277,6 @@ const SelectTickets = (props: SelectTicketsProps) => {
)}
-
{(event && ticketAreAvailable) && (
@@ -391,7 +389,7 @@ const SelectTickets = (props: SelectTicketsProps) => {
handleApplyPromoCode();
}
}} mb={0} ref={promoRef}/>
-