frontend: add a method to delete a customer

This commit is contained in:
Andreas Zweili 2021-02-15 16:13:26 +01:00
parent 6844eafb1a
commit 64fb1b79f9
1 changed files with 10 additions and 3 deletions

View File

@ -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/")