fix(medusa-react): Allow setting maxRetries on MedusaProvider (#5765)
* allow settign maxRetries on MedusaProvider * add changeset * set default maxRetries to 3
This commit is contained in:
committed by
GitHub
parent
f802e2460f
commit
4e9d954549
5
.changeset/large-swans-rule.md
Normal file
5
.changeset/large-swans-rule.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"medusa-react": patch
|
||||
---
|
||||
|
||||
fix(medusa-react): Allow setting maxRetries on MedusaProvider
|
||||
@@ -32,6 +32,11 @@ interface MedusaProviderProps {
|
||||
* available within the request
|
||||
*/
|
||||
publishableApiKey?: string
|
||||
/**
|
||||
* Number of times to retry a request if it fails
|
||||
* @default 3
|
||||
*/
|
||||
maxRetries?: number
|
||||
customHeaders?: Record<string, any>
|
||||
}
|
||||
|
||||
@@ -41,14 +46,15 @@ export const MedusaProvider = ({
|
||||
apiKey,
|
||||
publishableApiKey,
|
||||
customHeaders,
|
||||
maxRetries = 3,
|
||||
children,
|
||||
}: MedusaProviderProps) => {
|
||||
const medusaClient = new Medusa({
|
||||
baseUrl,
|
||||
maxRetries: 0,
|
||||
maxRetries,
|
||||
apiKey,
|
||||
publishableApiKey,
|
||||
customHeaders
|
||||
customHeaders,
|
||||
})
|
||||
return (
|
||||
<QueryClientProvider {...queryClientProviderProps}>
|
||||
|
||||
Reference in New Issue
Block a user