From 788337f6617bd5c622f9bcb196ec3c0e18d47e5a Mon Sep 17 00:00:00 2001 From: Florian LEROUX Date: Wed, 10 Jan 2024 12:50:02 +0100 Subject: [PATCH] fix(#35): change restaurant address structure --- .../app/(normal)/account/orders/[id]/map.tsx | 4 ++-- apps/web/app/(normal)/checkout/page.tsx | 2 +- apps/web/app/admin/page.tsx | 6 +++--- apps/web/components/location/restaurant.tsx | 4 ++-- apps/web/constants/data.ts | 20 +++++++++++++++---- apps/web/hooks/useLocation.tsx | 2 +- apps/web/types/restaurant.ts | 13 ++++++++++-- 7 files changed, 36 insertions(+), 15 deletions(-) diff --git a/apps/web/app/(normal)/account/orders/[id]/map.tsx b/apps/web/app/(normal)/account/orders/[id]/map.tsx index ebf12491..cfe7022c 100644 --- a/apps/web/app/(normal)/account/orders/[id]/map.tsx +++ b/apps/web/app/(normal)/account/orders/[id]/map.tsx @@ -14,8 +14,8 @@ export const OrderStatusMap = (order: Order) => { const { restaurants } = useLocation(); const restaurant = restaurants.find((r) => r.id === order.restaurant_id); - const { locationList: r_location } = restaurant || {}; - const [r_lat, r_lng] = r_location || [0, 0]; + const { address: r_location } = restaurant || {}; + const [r_lat, r_lng] = [r_location?.lat, r_location?.lng] || [0, 0]; // todo: move getting gps coordinates of address to service instead of client const { address } = order.delivery; diff --git a/apps/web/app/(normal)/checkout/page.tsx b/apps/web/app/(normal)/checkout/page.tsx index 05991303..4869e553 100644 --- a/apps/web/app/(normal)/checkout/page.tsx +++ b/apps/web/app/(normal)/checkout/page.tsx @@ -153,7 +153,7 @@ export default function CheckoutPage() {