From ee7cea6a4238e370dfd5293a82c99ad4a3a64c2c Mon Sep 17 00:00:00 2001 From: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:28:42 +0100 Subject: [PATCH] fix reservation loader --- .../src/routes/reservations/reservation-detail/loader.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/admin/dashboard/src/routes/reservations/reservation-detail/loader.ts b/packages/admin/dashboard/src/routes/reservations/reservation-detail/loader.ts index dedf1c4622ba0..1088cfb4f8c25 100644 --- a/packages/admin/dashboard/src/routes/reservations/reservation-detail/loader.ts +++ b/packages/admin/dashboard/src/routes/reservations/reservation-detail/loader.ts @@ -1,4 +1,3 @@ -import { HttpTypes } from "@medusajs/types" import { LoaderFunctionArgs } from "react-router-dom" import { reservationItemsQueryKeys } from "../../../hooks/api/reservations" import { sdk } from "../../../lib/client" @@ -13,9 +12,5 @@ export const reservationItemLoader = async ({ params }: LoaderFunctionArgs) => { const id = params.id const query = reservationDetailQuery(id!) - return ( - queryClient.getQueryData( - query.queryKey - ) ?? (await queryClient.fetchQuery(query)) - ) + return queryClient.ensureQueryData(query) }