store: get composes using limit and offset

The composeGetAll action is refactored to composesGet. It now uses
passes limit and offset as params so that pagination can be used. Also,
the COMPOSE_ADDED reducer case only adds new compose ids to allIds if
the id is new/unique.
This commit is contained in:
Jacob Kozol 2021-04-23 17:21:33 +02:00 committed by Sanne Raymaekers
parent 122c392ca3
commit 4f58f6202a
3 changed files with 10 additions and 11 deletions

View file

@ -43,7 +43,7 @@ class ImagesTable extends Component {
}
componentDidMount() {
this.props.composeGetAll();
this.props.composesGet(this.state.perPage, 0);
this.interval = setInterval(() => this.pollComposeStatuses(), 8000);
}
@ -140,14 +140,14 @@ function mapStateToProps(state) {
function mapDispatchToProps(dispatch) {
return {
composeGetAll: () => dispatch(actions.composeGetAll()),
composesGet: (limit, offset) => dispatch(actions.composesGet(limit, offset)),
composeGetStatus: (id) => dispatch(actions.composeGetStatus(id)),
};
}
ImagesTable.propTypes = {
composes: PropTypes.object,
composeGetAll: PropTypes.func,
composesGet: PropTypes.func,
composeGetStatus: PropTypes.func,
};