diff --git a/CHANGELOG.md b/CHANGELOG.md index 81f44741..570a3adf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +- Added fetch all to avoid removing slides when saving playlist and all slides have not been fetched. - [#223](https://github.com/os2display/display-admin-client/pull/223) - Updated to API Platform 3 - [#222](https://github.com/os2display/display-admin-client/pull/222) diff --git a/src/components/util/multi-and-table/select-slides-table.jsx b/src/components/util/multi-and-table/select-slides-table.jsx index fdabbcce..19c6b849 100644 --- a/src/components/util/multi-and-table/select-slides-table.jsx +++ b/src/components/util/multi-and-table/select-slides-table.jsx @@ -46,6 +46,11 @@ function SelectSlidesTable({ handleChange, name, slideId }) { return slide; }); setSelectedData([...selectedData, ...newSlides]); + + // Get all selected slides. If a next page is defined, get the next page. + if (data["hydra:view"]["hydra:next"]) { + setPage(page + 1); + } } }, [data]);