Delete db from server item with dynamic HTML without data-tables
Thu Oct 29 2020 00:33:32 GMT+0000 (Coordinated Universal Time)
Saved by
@robertjbass
<template>
<div class="selectedCard">
<div class="allPaymentsDelete"
v-for="payment in this.debtorPayments" :key="payment.id">
<a class="deletePaymentX" @click="deletePaymentFormat(payment.id)">X</a>
{{ formatDateMDY(payment.paymentdate.split("T")[0]) }}
{{ payment.assignedto }}
{{ payment.paymentstatus }}
</div>
</div>
</template>
<script>
methods: {
deletePaymentFormat(pid) {
let url = `${this.baseURL}deletepaymentbypid`;
let params = {
pid: pid,
host: this.serverDBase,
user: this.userDBase,
password: this.passDBase,
schema: this.schemaDBase,
};
this.deletePaymentByPid(url, params);
},
deletePaymentByPid(url, params) {
axios
.post(url, params)
.then((res) => {
console.log(res);
})
.catch((err) => {
console.error(err);
});
},
}
</script>
<style>
.deletePaymentX {
color: red;
font-weight: bold;
text-decoration: none;
}
</style>
content_copyCOPY
This script lets you make an API call with Axios to delete items using mostly HTML
See: https://imgur.com/a/5jMFN2V
https://imgur.com/a/5jMFN2V
Comments