Skip to content

Fetch class counts using Parse Query #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2016
Merged

Fetch class counts using Parse Query #18

merged 1 commit into from
Feb 27, 2016

Conversation

drew-gross
Copy link
Contributor

Parse Server doesn't have the bulk collection info endpoints, so we can't batch the count queries, unfortunately.

this.props.schema.data.get('classes').forEach((_, className) => {
this.context.currentApp.getClassCount(className)
.then(count => this.setState({ counts: { [className]: count, ...this.state.counts } }));
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;

Should be fine in the short term. For any of these requests where a batch doesn't exist we may consider having the dashboard node server make the request. But ideally we go straight to the api server without any application logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather not add any logic to the node thing that serves the dashboard. Adding logic to the server would be reasonable I think. But thats a debate for another time.

drew-gross added a commit that referenced this pull request Feb 27, 2016
Fetch class counts using Parse Query
@drew-gross drew-gross merged commit 3c904a3 into master Feb 27, 2016
@facebook-github-bot
Copy link

@drew-gross updated the pull request.

@peterdotjs peterdotjs deleted the classCounts branch March 9, 2016 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants