fix(dashboard): reservation inventory details (#9535)
**What** - display data in inventory details section of the reservation details page --- FIXES CC-595
This commit is contained in:
+11
-3
@@ -7,6 +7,7 @@ import { useReservationItem } from "../../../hooks/api/reservations"
|
|||||||
import { InventoryItemGeneralSection } from "../../inventory/inventory-detail/components/inventory-item-general-section"
|
import { InventoryItemGeneralSection } from "../../inventory/inventory-detail/components/inventory-item-general-section"
|
||||||
import { ReservationGeneralSection } from "./components/reservation-general-section"
|
import { ReservationGeneralSection } from "./components/reservation-general-section"
|
||||||
import { reservationItemLoader } from "./loader"
|
import { reservationItemLoader } from "./loader"
|
||||||
|
import { useInventoryItem } from "../../../hooks/api"
|
||||||
|
|
||||||
export const ReservationDetail = () => {
|
export const ReservationDetail = () => {
|
||||||
const { id } = useParams()
|
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()
|
const { getWidgets } = useDashboardExtension()
|
||||||
|
|
||||||
if (isLoading || !reservation) {
|
if (isLoading || !reservation) {
|
||||||
@@ -56,9 +64,9 @@ export const ReservationDetail = () => {
|
|||||||
<ReservationGeneralSection reservation={reservation} />
|
<ReservationGeneralSection reservation={reservation} />
|
||||||
</TwoColumnPage.Main>
|
</TwoColumnPage.Main>
|
||||||
<TwoColumnPage.Sidebar>
|
<TwoColumnPage.Sidebar>
|
||||||
<InventoryItemGeneralSection
|
{inventory_item && (
|
||||||
inventoryItem={reservation.inventory_item}
|
<InventoryItemGeneralSection inventoryItem={inventory_item} />
|
||||||
/>
|
)}
|
||||||
</TwoColumnPage.Sidebar>
|
</TwoColumnPage.Sidebar>
|
||||||
</TwoColumnPage>
|
</TwoColumnPage>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user