store: add get all composes api call

The ImagesTable will now trigger a thunk to fetch all of users composes
on load. The response of the /composes api call does not include status
so we currently only fetch the first 10 composes and fetch the status
for each of them.
This commit is contained in:
Jacob Kozol 2021-04-21 16:13:12 +02:00 committed by Sanne Raymaekers
parent 1f962b44ae
commit 9b08788fd2
3 changed files with 23 additions and 0 deletions

View file

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