-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Labels
Description
What Medusa version and documentation are you using?
v2
Preliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/medusajs/medusa/issues
Issue Summary
Following the docs to implement the digital products I found out the last step is not working properly.
When retrieving the list of digital products a customer has bought, the cache is forced so it never hits the API, therefore the digital products don't appear in the screen.
The mentioned file is the one placed under src/lib/data/digital-products.ts
.
How can this issue be resolved?
- Go to the mentioned file in
src/lib/data/digital-products.ts
. - This can be solved by just changing the cache param in the api call from
force-cache
tono-cache
orno-store
. - The function would look like this:
export const getCustomerDigitalProducts = async () => {
const headers = {
...(await getAuthHeaders()),
}
const next = {
...(await getCacheOptions("products")),
}
const { digital_products } = await sdk.client.fetch<{
digital_products: DigitalProduct[]
}>(`/store/customers/me/digital-products`, {
headers,
next,
cache: "no-cache",
})
return digital_products as DigitalProduct[]
}
Are you interested in working on this issue?
- I would like to fix this issue