I have a couple questions regarding my transition to FlowRouter that I haven’t been able to figure out myself, hopefully someone can assist!
FYI, My entire project was designed with the same coding conventions/methods as taught in Discover Meteor.
- Pagination is no longer working. Before it was handled by the router, but now that the router’s logic has been moved client side, I do not think that would work for pagination. Let’s say I wanted to sort my collection of Products by “top 10 cheapest price” - On client side I would need to send the entire collection in order for it to find which products are cheapest.
With FlowRouter, is there a way to control which items get published, so that I could send only the 10 cheapest products to client, and not have to send the entire collection?
- My Collection.update functions stopped working after the router update. Both on my “Edit” pages as well as my “Notifications” pages. These were both were based on DiscoverMeteors “Edit Post” and “Comment Notification” systems.
As an example…
ProductCollection.update(currentProductId, {$set: productProperties}, function(error) {
if (error) {
throwError(error.reason);
} else {
console.log(‘success’);
}
});
I removed the route redirect from “else” for testing purposes. That function is ran by the Edit code, and the “success” message is logged in chat, so it seems the code is not detecting any problems, but there are absolutely no changes to the product. Any ideas on how to repair this issue?
- Access denied page stopped working. Again, this was designed similar to DiscoverMeteor’s basis. Accounts system is still working for login & database functions. But the access denied routes are broken.
I seen a post on the kadira page on how to add verification on a template level, but I seen most users saying that’s not a good idea. I tend to agree, having to add logic to every template sounds troublesome.
Could anyone advise an elegant way of getting the access denied pages working again with FlowRouter?
Hope someone can help! Thanks!