Skip to content

Commit

Permalink
Added fetch of next pages for playlist selected slides list
Browse files Browse the repository at this point in the history
  • Loading branch information
tuj committed Jan 3, 2024
1 parent e329194 commit e781a7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions src/components/util/multi-and-table/select-slides-table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down

0 comments on commit e781a7e

Please sign in to comment.