wip
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user