Compenents REACT delete post with .reverse()

Hello i need help, my compenent React (deletepost) delete wrong post,
because function .reverse()(i need this for see recent post in first)https://github.com/GOANEX32/P7groupomania/blob/main/frontend/src/components/Post/Card.js

You are filtering by ID, reverse should have no effect on it. Are your ids unique?

Can you disconnect this from your backend? Just initialize with some dummy data and get it to work. Track it down, be a detective. Put in a console.log statement along each step of the way, figure out what where it stops doing what you expect.

Most troubling to me is your complete indifference to advice. A few people have taken the time to point out some structural problems with your app and you just ignore them.

I still don’t know where you are storing the posts - in local state or in redux.

You select it here:

const postData = useSelector((state) => state.postReducer);

but then the only place you use it is here:

      return axios
        .get(`${process.env.REACT_APP_API_URL}api/post/`)
        .then((res) => {
          
          setPost(res.data);
          }),[postData,userData]

which does absolutely nothing. That data doesn’t get used, unless I have some major misunderstanding about JS.

I think you aren’t clear on how you’re storing/getting your data. Again, I’ll say it again - get rid of the backend for now. Just do this pure frontend. If things are complicated, simplify until you get it to work and build from that. I’ve said it a couple of times already, but just store the data in redux and don’t store the posts in local state.

You use the variable name “post” twice in the same files, to refer to all posts and to refer to one post. We’ve pointed out confusion over file naming conventions. There are a bunch of other little things, but I’ve been ignoring them for the sake of the big picture.

imho, you are trying to go too fast, you need to get the structure of the app figured out.

It’s like you’re trying to build a car, and you are asking us how to set the fuel injectors, and we are telling you that you have the wrong radiator, the trunk is on fire, there is a crack in the frame, and there is a huge hole in the oil pan. We keep saying to fix those first. And you just keep saying, “I’m going to ignore all that, I just want to set this fuel injector so I can go for a drive.”

It is all fixable, but you are going to have to pay attention to it.

I use sate
as requestedhttps://github.com/GOANEX32/P7groupomania/blob/main/frontend/src/components/Post/Card.js
but my post dont appear

You are using both local state and redux in your app. My suggestion is to just use redux for the posts. You are trying to store it in two places but only updating one. I’ve mentioned this several times.

I see that you’ve removed the local state. Good. Now what is the issue?

my post map dont work(i dont see my post)