From 75475f7b282c3c8b01957ede71c8d4ed1471c8a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Frane=20Poli=C4=87?=
<16856471+fPolic@users.noreply.github.com>
Date: Mon, 14 Oct 2024 19:59:52 +0200
Subject: [PATCH] fix(dashboard): reservation inventory details (#9535)
**What**
- display data in inventory details section of the reservation details page
---
FIXES CC-595
---
.../reservation-detail/reservation-detail.tsx | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/packages/admin/dashboard/src/routes/reservations/reservation-detail/reservation-detail.tsx b/packages/admin/dashboard/src/routes/reservations/reservation-detail/reservation-detail.tsx
index 8868be41b4..fa2c099b4f 100644
--- a/packages/admin/dashboard/src/routes/reservations/reservation-detail/reservation-detail.tsx
+++ b/packages/admin/dashboard/src/routes/reservations/reservation-detail/reservation-detail.tsx
@@ -7,6 +7,7 @@ import { useReservationItem } from "../../../hooks/api/reservations"
import { InventoryItemGeneralSection } from "../../inventory/inventory-detail/components/inventory-item-general-section"
import { ReservationGeneralSection } from "./components/reservation-general-section"
import { reservationItemLoader } from "./loader"
+import { useInventoryItem } from "../../../hooks/api"
export const ReservationDetail = () => {
const { id } = useParams()
@@ -23,6 +24,13 @@ export const ReservationDetail = () => {
}
)
+ // TEMP: fetch directly since the fields are not populated with reservation call
+ const { inventory_item } = useInventoryItem(
+ reservation?.inventory_item?.id!,
+ undefined,
+ { enabled: !!reservation?.inventory_item?.id! }
+ )
+
const { getWidgets } = useDashboardExtension()
if (isLoading || !reservation) {
@@ -56,9 +64,9 @@ export const ReservationDetail = () => {
-
+ {inventory_item && (
+
+ )}
)