From 967c0debea58811ccb443e888ffd9564ffc782eb Mon Sep 17 00:00:00 2001 From: Nurmuhammet Allanov Date: Thu, 25 Sep 2025 03:30:48 +0500 Subject: [PATCH] wip --- src/app/api/orderApi.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/app/api/orderApi.js b/src/app/api/orderApi.js index f033d3b..fe8378b 100644 --- a/src/app/api/orderApi.js +++ b/src/app/api/orderApi.js @@ -11,16 +11,22 @@ export const orderApi = baseApi.injectEndpoints({ query: (orderId) => `/orders/${orderId}`, transformResponse: (response) => response.data || null, }), + placeOrder: builder.mutation({ - query: (orderDetails) => ({ - url: "/orders", - method: "POST", - body: new URLSearchParams(orderDetails), - headers: { - "Accept": "application/json", - "Content-Type": "application/x-www-form-urlencoded", - }, - }), + query: (orderDetails) => { + console.log({ + watch: orderDetails + }) + return { + url: "/orders", + method: "POST", + body: new URLSearchParams(orderDetails), + headers: { + "Accept": "application/json", + "Content-Type": "application/x-www-form-urlencoded", + }, + }; + }, transformResponse: (response, meta, arg) => { console.log({response: response}) if (response && response.data) {