title: Error: Request failed with status code 404 axios.put
body: <p>I am trying to update my database with axios.</p>
  <p>Here is my frontend part</p>
  <pre><code>const [updateData, setUpdateData] = useState({ price: &quot;&quot;, sale: null });
   const updateProperty = async () =&gt; {
  try {
    const response = await apiReq.put(
      `/propertys/update/${data._id}`,
      updateData
    );
    navigate(-1);
    console.log(response);
  } catch (error) {
    console.log(error);
  }
  </code></pre>
  <p>};</p>
  <p><code>onClick={updatePropert}</code> is executing this request.</p>
  <p>Backend Controller :</p>
  <pre><code>export const updateProperty = async (req, res) =&gt; {
    try {
      const property = await propertys.findById(req.params.id);
      if (!property) {
        return res.status(404).json({ message: &quot;Property doesn't exist.&quot; });
      }
      try {
        const updatedProperty = await propertys.findByIdAndUpdate(
          req.params.id,
          { $set: req.body },
          { new: true }
        );
        res.status(200).json(updatedProperty);
      } catch (error) {
        res.status(500).json({ message: &quot;Something went wrong&quot; });
      }
    } catch (error) {
      res.status(500).json({ message: &quot;Something went wrong&quot; });
    }
  };
  </code></pre>