#blog tutorial issue w/ collections

1 messages · Page 1 of 1 (latest)

quaint tusk
#

Possibly a non-issue
but i feel the tutorial skips the changing of the following code.. is it important?

glob() version >

const filteredPosts = allPosts.filter((post: any) => post.frontmatter.tags.includes(tag));

into > getCollection() version

const filteredPosts = allPosts.filter((post) => post.data.tags.includes(tag));

i was struggling to make my code work when following the tutorial, and i've noticed this difference that's not explicitly instructed to update, like, usually it would be highlighted in green to say update and red to remove -
i'm trying everything but just thought i'd see if i'm overthinking it or not

#

I restarted my dev and it works now! not sure if it was the changed code above or something else, but i'll still leave this up just in case

tight fossil
worn sigilBOT
#
If your issue is resolved, please help by doing the following two steps:
  1. From the ellipses (3-dot menu) in the top-right corner of the post (not the first message), edit the tags to include the Solved tag.
  2. From the same ellipses, select Close Post.
    Your post will still be available to search and can be re-opened simply by replying in it. Closing a post moves it down with older posts, so we can more easily focus on issues that still need to be resolved.
    Thank you for your help!
quaint tusk
quaint tusk
tight fossil