diff --git a/docs/DataProviderWriting.md b/docs/DataProviderWriting.md index 54795b611fa..3fe360c9dc3 100644 --- a/docs/DataProviderWriting.md +++ b/docs/DataProviderWriting.md @@ -687,7 +687,7 @@ Here is an example implementation, that you can use as a base for your own Data ```js import { fetchUtils } from 'react-admin'; -import { stringify } from 'query-string'; +import queryString from 'query-string'; const apiUrl = 'https://my.api.com/'; const httpClient = fetchUtils.fetchJson; @@ -701,7 +701,7 @@ export default { range: JSON.stringify([(page - 1) * perPage, page * perPage - 1]), filter: JSON.stringify(params.filter), }; - const url = `${apiUrl}/${resource}?${stringify(query)}`; + const url = `${apiUrl}/${resource}?${queryString.stringify(query)}`; const { json, headers } = await httpClient(url, { signal: params.signal }); return { data: json, @@ -719,7 +719,7 @@ export default { const query = { filter: JSON.stringify({ ids: params.ids }), }; - const url = `${apiUrl}/${resource}?${stringify(query)}`; + const url = `${apiUrl}/${resource}?${queryString.stringify(query)}`; const { json } = await httpClient(url, { signal: params.signal }); return { data: json }; }, @@ -735,7 +735,7 @@ export default { [params.target]: params.id, }), }; - const url = `${apiUrl}/${resource}?${stringify(query)}`; + const url = `${apiUrl}/${resource}?${queryString.stringify(query)}`; const { json, headers } = await httpClient(url, { signal: params.signal }); return { data: json, @@ -764,7 +764,7 @@ export default { const query = { filter: JSON.stringify({ id: params.ids}), }; - const url = `${apiUrl}/${resource}?${stringify(query)}`; + const url = `${apiUrl}/${resource}?${queryString.stringify(query)}`; const { json } = await httpClient(url, { method: 'PUT', body: JSON.stringify(params.data), @@ -784,7 +784,7 @@ export default { const query = { filter: JSON.stringify({ id: params.ids}), }; - const url = `${apiUrl}/${resource}?${stringify(query)}`; + const url = `${apiUrl}/${resource}?${queryString.stringify(query)}`; const { json } = await httpClient(url, { method: 'DELETE', body: JSON.stringify(params.data), diff --git a/docs/ListTutorial.md b/docs/ListTutorial.md index c7cf72e631a..c5771a9b898 100644 --- a/docs/ListTutorial.md +++ b/docs/ListTutorial.md @@ -700,7 +700,7 @@ For instance, if you have a list of posts ordered by publication date, and you w ```tsx import Button from '@mui/material/Button'; import { Link } from 'react-router-dom'; -import { stringify } from 'query-string'; +import queryString from 'query-string'; const SortByViews = () => (