frontend: add a method to delete a customer
This commit is contained in:
parent
6844eafb1a
commit
64fb1b79f9
|
@ -28,9 +28,7 @@
|
|||
<td><a :href="customer.url">Licenses</a></td>
|
||||
<td><a :href="customer.url">Users</a></td>
|
||||
<td>
|
||||
<a :href="customer.url"
|
||||
><div class="delete material-icons">delete</div></a
|
||||
>
|
||||
<a href="#" @click="deleteCustomer(customer.url)">delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -45,6 +43,15 @@ export default {
|
|||
customers: [],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
deleteCustomer(url){
|
||||
getAPI.delete(url)
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
this.customers = this.customers.filter(customer => customer.url !== url)
|
||||
},
|
||||
},
|
||||
created() {
|
||||
getAPI
|
||||
.get("/customers/")
|
||||
|
|
Loading…
Reference in New Issue