Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ export const ReservationEdit = () => {

const { reservation, isPending, isError, error } = useReservationItem(id!)
const { inventory_item: inventoryItem } = useInventoryItem(
reservation?.inventory_item_id!
reservation?.inventory_item_id!,
undefined,
{
enabled: !!reservation?.inventory_item_id,
}
)

const { location_levels } = useInventoryItemLevels(inventoryItem?.id!)
const { location_levels } = useInventoryItemLevels(inventoryItem?.id!, undefined, {
enabled: !!inventoryItem?.id,
})

const { stock_locations } = useStockLocations(
undefined,
Expand All @@ -34,7 +40,7 @@ export const ReservationEdit = () => {
}
)

const ready = !isPending && reservation && inventoryItem && stock_locations
const ready = !isPending && reservation && inventoryItem && location_levels && stock_locations
if (isError) {
throw error
}
Expand Down