Remove unnecessary SQL queries
mindaugasvcs opened this issue · 1 comments
mindaugasvcs commented
demo/src/Controller/BlogController.php
Line 55 in 206f0c9
Hi,
I think a reference application should not promote unnecessary SQL queries. You fetch a tag object from DB then execute another SQL call, why not just passing a tag as a string to the PostRepository instead? Can I offer PR to fix this line to use just one SQL call?
GromNaN commented
This query return null if the tag is not found. So the subsequent query has not filter on the tag.
This is not an ideal behavior for users. It would be better to return a 404 when no article are found with the given tag (that's what news websites does of SEO).