This commit is contained in:
2025-09-25 03:50:23 +05:00
parent 696edbca1d
commit 36e19054e8

View File

@@ -17,6 +17,7 @@ export const orderApi = baseApi.injectEndpoints({
orderDetails.shipping_method = 'standart';
orderDetails.delivery_time = '13:00 - 18:00';
orderDetails.region = 'ag';
orderDetails.payment_type_id = 3;
return {
url: "/orders",
@@ -29,11 +30,14 @@ export const orderApi = baseApi.injectEndpoints({
};
},
transformResponse: (response, meta, arg) => {
console.log({response: response})
// if (response && response.data) {
// return response.data;
// }
// return "Order placed";
if (response && response.data) {
if (response.data.payment_url) {
window.open(response.data.payment_url, '_blank').focus();
}
return response.data;
}
return "Order placed";
},
transformErrorResponse: (response, meta, arg) => {