Open ksraj123 opened 4 years ago
@ksraj123 and @AuraOfDivinity, I'd like to fix this issue. Could you please assign it to me?
@trinadhmoganti I don't think anyone else is working on this issue! So, Maybe go ahead with solving this. But before that may I know how are you planning to solve this?
I would like to fix this bug . Can you please assign this issue to me?
@trinadhmoganti I don't think anyone else is working on this issue! So, Maybe go ahead with solving this. But before that may I know how are you planning to solve this?
To me, it looksooks like it's an issue with state. I'm thinking that updating the frontend state after delete success api call should solve this issue.
@trinadhmoganti I don't think anyone else is working on this issue! So, Maybe go ahead with solving this. But before that may I know how are you planning to solve this?
To me, it looksooks like it's an issue with state. I'm thinking that updating the frontend state after delete success api call should solve this issue.
I see that in postActions, we're dispatching getAllPost() which is trying to get all posts from the API. I think instead of trying to get all posts again, what we may do is use .filter() to remove the deleted post from the state on success.
@AuraOfDivinity, @ksraj123, @Rupeshiya, what do you say?
@lazycipher I would like to work on this issue,
I can see that here there is a GET_ALL_POSTS
that I guess is fetching the data from the API, If we create another action that takes the id of posts and returns a new list except for the one post, with the matching _id
as you said earlier with using filter
.
Fixed in some PR! Please close @vaibhavdaren.
Describe the bug The UI does not update when a post is deleted. Request to delete the post to backend works as expected.
Steps to Reproduce Step 1: Create a post Step 2: Hit the API through postman to fetch the list of all posts, the post we created in step 1 would be in this list Step 3: Delete the post though frontend Step 4: Hit the API through postman to fetch the list of all posts, the post we created in step 1 would NOT be in the list but it's still visible on the frontend.
Expected behavior The UI should update on the successful deletion of the post.
Screenshots
Desktop:
Additional context Hacktoberfest