title: Edit product fields from MongoDB in VueJS based on ObjectID inserted into PATCH request link
body: <p>It may be a simple one, but for some reason, I can't figure it out :(.
  I'm making a fullstack app using MongoDB, NestJS, and VueJS that consists in a form that is adding different products in a MongoDB database.</p>
  <p>The problem I'm facing right now is that I want to be able to edit each product that exists in the database, using the next logic :
  Click on EDIT button -&gt; Fill in the pop-up with updated info -&gt; Click on the UPDATE button</p>
  <p>Example :
  <a href="https://i.stack.imgur.com/gM7dU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gM7dU.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/x2NW3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x2NW3.png" alt="enter image description here" /></a></p>
  <p>The problem I'm facing right now is the imposibility of selecting only the specific product I'm trying to edit into my VueJS app.</p>
  <p>To be more precise, I'm thinking I need a way to get the ID somtehing like :</p>
  <pre><code>axios.patch(`http://localhost:3000/produse/${this.produsModificat.id}`)
  </code></pre>
  <p>The functionality of the editing works. If instead of ${this.produsModificat.id}</p>
  <p>I use http://localhost:3000/produse/61a51cecdfb9ea1bd939587b it works.</p>
  <p>So what I'm trying to do is to automaticly get the ID when the EDIT button is clicked.</p>
  <p>I am trying to select each product by the unique ID generated into MongoDB (see picture below for example) but I cannot find a way to do this and it drives me nuts :(.</p>
  <p><a href="https://i.stack.imgur.com/npMkb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/npMkb.png" alt="enter image description here" /></a></p>
  <p>Can someone point me please into the right direction in how can I achieve this?</p>
  <p>Below you can find the logic that I implemented for the PATCH request both in frontend file</p>
  <p>Filename : Table.vue</p>
  <pre><code>        updateProduct() {
          let produsModificat = {
              Name: this.Produs.Name,
              Code: this.Produs.Code,
              Weight: this.Produs.Weight,
              Price: this.Produs.Price,
              Color: this.Produs.Color,
              isDeleted: this.Produs.isDeleted
          }
          console.log(this)
      axios.patch(`http://localhost:3000/produse/${this.produsModificat.id}`)
      .then((response) =&gt; {
          console.log(response);
          })
          .catch((error) =&gt; {
          console.log(error);
          })
          console.log();
          return produsModificat
      },
  </code></pre>