wip
This commit is contained in:
@@ -11,8 +11,13 @@ export const orderApi = baseApi.injectEndpoints({
|
|||||||
query: (orderId) => `/orders/${orderId}`,
|
query: (orderId) => `/orders/${orderId}`,
|
||||||
transformResponse: (response) => response.data || null,
|
transformResponse: (response) => response.data || null,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
placeOrder: builder.mutation({
|
placeOrder: builder.mutation({
|
||||||
query: (orderDetails) => ({
|
query: (orderDetails) => {
|
||||||
|
console.log({
|
||||||
|
watch: orderDetails
|
||||||
|
})
|
||||||
|
return {
|
||||||
url: "/orders",
|
url: "/orders",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: new URLSearchParams(orderDetails),
|
body: new URLSearchParams(orderDetails),
|
||||||
@@ -20,7 +25,8 @@ export const orderApi = baseApi.injectEndpoints({
|
|||||||
"Accept": "application/json",
|
"Accept": "application/json",
|
||||||
"Content-Type": "application/x-www-form-urlencoded",
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
},
|
},
|
||||||
}),
|
};
|
||||||
|
},
|
||||||
transformResponse: (response, meta, arg) => {
|
transformResponse: (response, meta, arg) => {
|
||||||
console.log({response: response})
|
console.log({response: response})
|
||||||
if (response && response.data) {
|
if (response && response.data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user