title: Updating a spring database from a react switch element
body: <p>I have a list of users and their account status as a table in my react js application. This table entry is fetched from an API call. Now when I click on a button, the value of account status has to be updated in the database. The endpoint is working fine and I've tested it also.</p>
  
  <p>I've created a button for each user to update the database. It's currently not updating the value in the database. </p>
  
  <p>React Material UI code :-</p>
  
  <pre><code>&lt;TableBody&gt;
                  {items.map(item =&gt; (
                        &lt;TableRow key={item.username}&gt;
                          &lt;TableCell component="th" scope="item"&gt;
                            {item.username}
                          &lt;/TableCell&gt;
                          &lt;TableCell&gt;
                          &lt;Button onClick={this.onItemClick} variant="contained"&gt;
                            Update Status
                          &lt;/Button&gt;
                          &lt;/TableCell&gt;
                        &lt;/TableRow&gt;
                  ))}
                &lt;/TableBody&gt;
  </code></pre>
  
  <p>the onItemClick handler has to make an API Call and update the database value accordingly.
  Kindly provide some help regarding the approach to be followed. Thank you</p>