-
Notifications
You must be signed in to change notification settings - Fork 210
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
Proper way to pass parameters from client to server #339
Comments
In your publish query there is _id and in your client query there is id. Guess that could cause some discrepancy. |
@Nauzer Thanks I updated my post and fixed it in my code but the problem still persists. Is it working in your projects? |
Haven't used the library in a while... but I think so. On the client you should query 'quests' collection, not the publication name. Do you have 'autopublish' turned off on your Meteor server? |
I dont have autopublish turned off - will this affect behaviour? Apologies for being an absolute noob. |
@Nauzer thanks it worked!!! |
Hey guys,
I've been struggling with this for days. I have my server set up as:
Meteor.publish('quests_filtered', (id) => { return Quests.find({'_id': id}); });
And my client like the below. You can think of quests exactly like a to do list.
export default withTracker(params => { Meteor.subscribe('quests_filtered', params.id); return { quests: Meteor.collection('quests_filtered').find({'_id': id}), }; })(QuestFeed);
The collection is defined as:
const Quests = new Mongo.Collection('quests');
However this.props.quests in the client side still returns the whole Quests collection and not those filtered by id.
I am at a complete loss - any ideas?
The text was updated successfully, but these errors were encountered: