I am facing an issue with updating a table on my page after deleting a row. Each row in the table has a delete button and I have tried using window.location.reload()
but it didn't work.
</va-card>
<br/>
<va-card >
<va-table :hover="hover" :size="size" v-if="approveduserData.length" >
<table style="width:100%;" >
<thead >
<tr style="font-weight:bold;font-size:19px">
<th>Username</th>
<th>Email</th>
<th>Mobile</th>
<th>Delete User</th>
</tr>
</thead>
</tbody>
<tr v-for="user in approveduserData">
<td style="font-weight:bold">{{user.username}}</td>
<td>{{user.email}}</td>
<td>{{user.phone}}</td>
<td><va-button color="danger" v-on:click="Deactivate(user.email,user.username)"> Deactivate</va-button></td>
</tr>
</tbody>
</table>
</va-table>
</va-card>
// Here is the deactivate function
Deactivate:function(email,name){
const rejectUser = {
"email":email
}
if(confirm("Do you want to Remove "+ name +" Account??"))
{
axios.post('http://34.67.88.0:3000/api/userrejected',rejectUser)
.then(function(res){
self.outputRejected = res.data;
if(self.outputRejected){
alert( name+" Account Successfully Deleted!!")
}
})
.catch(function(error){
console.log("Error",error)
})
}
}