remove extra bottom sheet in checkout page make all them inside the page iteslef

This commit is contained in:
2025-12-02 01:51:14 +03:00
parent cf5babeaa5
commit 2af2c34826
8 changed files with 266 additions and 43 deletions

View File

@@ -13,7 +13,11 @@ import {
import { OrderDetails } from "pages/checkout/hooks/types";
import menuParser from "pages/menu/helper";
import { DiscountResultType, RestaurantDetails, UserType } from "utils/types/appTypes";
import {
DiscountResultType,
RestaurantDetails,
UserType,
} from "utils/types/appTypes";
import { baseApi } from "./apiSlice";
export const branchApi = baseApi.injectEndpoints({
@@ -27,7 +31,9 @@ export const branchApi = baseApi.injectEndpoints({
},
}),
transformResponse: (response: any) => {
return response?.result?.restaurants?.[0];
return response?.result?.restaurants?.find(
(restaurant: RestaurantDetails) => restaurant.distance === 595,
);
},
providesTags: ["Restaurant"],
}),
@@ -124,18 +130,15 @@ export const branchApi = baseApi.injectEndpoints({
return response.result;
},
}),
getUserDetails: builder.query<
UserType,
void
>({
query: () => ({
url: `${USER_DETAILS_URL}`,
method: "GET",
getUserDetails: builder.query<UserType, void>({
query: () => ({
url: `${USER_DETAILS_URL}`,
method: "GET",
}),
transformResponse: (response: any) => {
return response.result;
},
}),
transformResponse: (response: any) => {
return response.result;
},
}),
rateOrder: builder.mutation({
query: ({
orderID,