title: axios req failed Error: Request failed with status code 404 at createError (createError.js:16) at settle (settle.js:17) at XMLHttpRequest.handleLoad
body: <p>my patch request is not working.When I make patch request without <strong>AsyncThunk</strong>, it works fine and doesn't give any error but when using Thunk it fails and giving following error.
  Error can be seen here in this image</p>
  <p>[![enter image description here][1]][1]
  I am sending postData(underlined blue) .but I am unable to find why it is showing payload undefined.
  [![enter image description here][2]][2]
  Plus I am passing 2 values as object to &quot;asyncThunk&quot; because it takes only one argument as a payload.Is that is the problem or not!
  [![enter image description here][3]][3]</p>
  <pre><code>export const updatePost=createAsyncThunk(
      'Post/updatePost',
      async({id,updatePost})=&gt;{
        try{
        const {data}=await api.updatePost(id,updatePost);
        console.log(data)
         return data;
  
        }catch(err){
          console.log('axios patch req failed',err)
        }
      }
  )
  
  const postSlice=createSlice({
  name:'Post',
  initialState:{
  posts:[],
  status:'failure'
  },
  extraReducers:{
  [updatePost.fulfilled]:(state,action)=&gt;{
    console.log(action.payload)
      state.status='success'
                
      return state.posts.map((post)=&gt;post._id === action.payload._id ?action.payload :post)
    },
    [updatePost.pending]:(state,action)=&gt;{
      state.status='pending'
      console.log('pending due to',action)
  
    },
    [updatePost.rejected]:(state,action)=&gt;{
      state.status='rejected'
      console.log('updatePost is rejected',action)
  
    }
  }
  })```
  
  ** here is my patch request function **
  
  ```export const updatePost=(id,updatePost)=&gt;axios.patch(`${url}/${id}`,updatePost)```
  
  ** dispatching my action **
  ```dispatch(updatePost({currentId,postData}))```
  
  
    [1]: https://i.stack.imgur.com/Wb37y.png
    [2]: https://i.stack.imgur.com/86a4l.png
    [3]: https://i.stack.imgur.com/o0CLP.png
  </code></pre>