From 5b33a21c396efefd5f7188c5adb4fdeb5073319b Mon Sep 17 00:00:00 2001 From: adguernier Date: Tue, 20 Jun 2023 16:09:33 +0200 Subject: [PATCH 1/3] add missing constante in code snippets --- docs/ListTutorial.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/ListTutorial.md b/docs/ListTutorial.md index a2da1a294d8..0962fd23182 100644 --- a/docs/ListTutorial.md +++ b/docs/ListTutorial.md @@ -43,10 +43,11 @@ const BookList = () => { const [filter, setFilter] = useState(''); const [page, setPage] = useState(1); const perPage = 10; + const sort = { field: 'id', order: 'ASC' }; const { data, total, isLoading } = useGetList('books', { filter: { q: filter }, pagination: { page, perPage }, - sort: { field: 'id', order: 'ASC' } + sort }); if (isLoading) { return
Loading...
; @@ -125,10 +126,11 @@ const BookList = () => { const [filter, setFilter] = useState(''); const [page, setPage] = useState(1); const perPage = 10; + const sort = { field: 'id', order: 'ASC' }; const { data, total, isLoading } = useGetList('books', { filter: { q: filter }, pagination: { page, perPage }, - sort: { field: 'id', order: 'ASC' } + sort }); if (isLoading) { return
Loading...
; From 8c0a6895f89f4fca57c49f773ae33144e69b5c92 Mon Sep 17 00:00:00 2001 From: adguernier Date: Tue, 20 Jun 2023 16:53:39 +0200 Subject: [PATCH 2/3] remove sort in wrong section and add + before added constant --- docs/ListTutorial.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/ListTutorial.md b/docs/ListTutorial.md index 0962fd23182..eb3921de12e 100644 --- a/docs/ListTutorial.md +++ b/docs/ListTutorial.md @@ -43,7 +43,6 @@ const BookList = () => { const [filter, setFilter] = useState(''); const [page, setPage] = useState(1); const perPage = 10; - const sort = { field: 'id', order: 'ASC' }; const { data, total, isLoading } = useGetList('books', { filter: { q: filter }, pagination: { page, perPage }, @@ -126,7 +125,7 @@ const BookList = () => { const [filter, setFilter] = useState(''); const [page, setPage] = useState(1); const perPage = 10; - const sort = { field: 'id', order: 'ASC' }; ++ const sort = { field: 'id', order: 'ASC' }; const { data, total, isLoading } = useGetList('books', { filter: { q: filter }, pagination: { page, perPage }, From 772964172a5d5e22a8d2abee6d55c00fd3d57df7 Mon Sep 17 00:00:00 2001 From: adguernier Date: Tue, 20 Jun 2023 17:40:02 +0200 Subject: [PATCH 3/3] define sort in first useGetList --- docs/ListTutorial.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ListTutorial.md b/docs/ListTutorial.md index eb3921de12e..9a3d2bfff77 100644 --- a/docs/ListTutorial.md +++ b/docs/ListTutorial.md @@ -46,7 +46,7 @@ const BookList = () => { const { data, total, isLoading } = useGetList('books', { filter: { q: filter }, pagination: { page, perPage }, - sort + sort: { field: 'id', order: 'ASC' } }); if (isLoading) { return
Loading...
; @@ -129,7 +129,7 @@ const BookList = () => { const { data, total, isLoading } = useGetList('books', { filter: { q: filter }, pagination: { page, perPage }, - sort ++ sort }); if (isLoading) { return
Loading...
;