adrianhajdin / project_mern_memories

This is a code repository for the corresponding video tutorial. Using React, Node.js, Express & MongoDB you'll learn how to build a Full Stack MERN Application - from start to finish. The App is called "Memories" and it is a simple social media app that allows users to post interesting events that happened in their lives.
https://youtube.com/playlist?list=PL6QREj8te1P7VSwhrMf3D3Xt4V6_SRkhu
5k stars 1.84k forks source link

409 conflict error at the end of 'User Actions' of part 3 #77

Closed kevinginta closed 2 years ago

kevinginta commented 2 years ago

I'm getting a 409 conflict error at the end of 'User Actions' of part 3. I'm unable to submit posts even though the data shows up correctly in the request payload and the request headers also look good. Anyone else run into this problem? I have a feeling it has something to do with this logic in Form.js and how maybe it's trying to update instead of create?:

if (currentId === 0) { dispatch(createPost({ ...postData, name: user?.result?.name })); clear(); } else { dispatch(updatePost(currentId, { ...postData, name: user?.result?.name })); clear(); } };

Any help would be appreciated. Thank you!

kevinginta commented 2 years ago

nevermind silly syntax mistake