ui(nests): fix broken pagination

This commit is contained in:
Matthew Penner 2021-03-23 17:10:30 -06:00
parent 984a774811
commit 7b38f05019

View file

@ -42,7 +42,13 @@ export default (include: string[] = []) => {
const { page } = useContext(Context); const { page } = useContext(Context);
return useSWR<PaginatedResult<Nest>>([ 'nests', page ], async () => { return useSWR<PaginatedResult<Nest>>([ 'nests', page ], async () => {
const { data } = await http.get('/api/application/nests', { params: { include: include.join(','), page } }); const { data } = await http.get('/api/application/nests', {
params: {
include: include.join(','),
per_page: 10,
page,
},
});
return ({ return ({
items: (data.data || []).map(rawDataToNest), items: (data.data || []).map(rawDataToNest),