Skip to content

Commit

Permalink
fix promotions loader
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperkristensen committed Nov 13, 2024
1 parent ee7cea6 commit 62cc1fe
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { HttpTypes } from "@medusajs/types"
import { LoaderFunctionArgs } from "react-router-dom"
import { promotionsQueryKeys } from "../../../hooks/api/promotions"
import { sdk } from "../../../lib/client"
Expand All @@ -13,9 +12,5 @@ export const promotionLoader = async ({ params }: LoaderFunctionArgs) => {
const id = params.id
const query = promotionDetailQuery(id!)

return (
queryClient.getQueryData<HttpTypes.AdminPromotionResponse>(
query.queryKey
) ?? (await queryClient.fetchQuery(query))
)
return queryClient.ensureQueryData(query)
}

0 comments on commit 62cc1fe

Please sign in to comment.