Tuesday 28 April 2020

I have a small problem

bear with me, this might sound stupid. and if there's a better approach for this let me know​I have a User and Post model, I'm trying to store an array of posts on a specific User whenever he clicks 'Add to favorite' button. I'm adding them successfully. but I'm not able to remove it from that array. (I'm sending a boolean value to check)I'm trying to console.log the array after the filter method but nothing is being displayed.. here's my code:https://preview.redd.it/58grt8g8oiv41.png?width=1366&format=png&auto=webp&s=758bb50896558b3d2eaacb96855b2fb428f7f5a1and here I tried to console.log it outside the else block, but it was executed before the else blockhttps://preview.redd.it/65k559pyniv41.png?width=1366&format=png&auto=webp&s=dce5394e87c15801e08b37afaad21f0149577b1e

Submitted April 28, 2020 at 09:12AM by Sakalalaa

No comments:

Post a Comment