Fix Tim Coding.
This commit is contained in:
Binary file not shown.
@@ -95,5 +95,6 @@
|
|||||||
"telephone": "Telefon",
|
"telephone": "Telefon",
|
||||||
"basketEmpty": "Der Warenkorb ist leer.",
|
"basketEmpty": "Der Warenkorb ist leer.",
|
||||||
"login": "Anmelden",
|
"login": "Anmelden",
|
||||||
"total": "Insgesamt"
|
"total": "Insgesamt",
|
||||||
|
"admin": "Admin"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,5 +95,6 @@
|
|||||||
"telephone": "Telephone",
|
"telephone": "Telephone",
|
||||||
"basketEmpty": "The shopping cart is empty.",
|
"basketEmpty": "The shopping cart is empty.",
|
||||||
"login": "Login",
|
"login": "Login",
|
||||||
"total": "Total"
|
"total": "Total",
|
||||||
}
|
"admin": "Admin"
|
||||||
|
}
|
||||||
@@ -117,8 +117,16 @@ export default function Payment() {
|
|||||||
</Alert>
|
</Alert>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const { refetch: refetchSubmit, isError: orderIsError } = useQuery({
|
||||||
|
queryKey: ["submitOrder", submitOrderData],
|
||||||
|
queryFn: () => submitOrder(submitOrderData),
|
||||||
|
retry: 0,
|
||||||
|
retryDelay: 1000,
|
||||||
|
enabled: false,
|
||||||
|
});
|
||||||
|
|
||||||
const handleNext = async () => {
|
const handleNext = async () => {
|
||||||
var next: boolean = true;
|
let next: boolean = true;
|
||||||
|
|
||||||
if (activeStep === steps.length - 2) {
|
if (activeStep === steps.length - 2) {
|
||||||
// Simulate order placement and generate order number
|
// Simulate order placement and generate order number
|
||||||
@@ -130,13 +138,7 @@ export default function Payment() {
|
|||||||
console.log(await (await refetchCustomer()).data.id);
|
console.log(await (await refetchCustomer()).data.id);
|
||||||
submitOrderData.customerId = await (await refetchCustomer()).data.id; // Get the customer ID from the response
|
submitOrderData.customerId = await (await refetchCustomer()).data.id; // Get the customer ID from the response
|
||||||
}
|
}
|
||||||
const { refetch: refetchSubmit, isError: orderIsError } = useQuery({
|
|
||||||
queryKey: ["submitOrder", submitOrderData],
|
|
||||||
queryFn: () => submitOrder(submitOrderData),
|
|
||||||
retry: 0,
|
|
||||||
retryDelay: 1000,
|
|
||||||
enabled: false,
|
|
||||||
});
|
|
||||||
void refetchSubmit(); // Submit order data
|
void refetchSubmit(); // Submit order data
|
||||||
if(orderIsError) {
|
if(orderIsError) {
|
||||||
next = false
|
next = false
|
||||||
|
|||||||
Reference in New Issue
Block a user