Pick-and-buy / LUXBAG-AdminDashBoard

0 stars 0 forks source link

Error of not displaying posts when pressing "Áp Dụng" without selecting the checkbox #19

Closed nguyentienthanhe150825 closed 3 months ago

nguyentienthanhe150825 commented 3 months ago

When you do not select any item in the checkbox and click "Apply", the list of posts will not be displayed.

nguyentienthanhe150825 commented 3 months ago

When no items are selected in the checkbox and "Apply" is pressed, the filter.brand value will be an empty or undefined array. In that case, the code posts = posts.filter((post) => filter.brand.includes(post.product.brand.name)); won't return any posts, so the posts list is empty.