fix: duplicate call
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
9d7db2020b
commit
76a77dcee9
|
@ -53,7 +53,7 @@ const tableRef = ref([]);
|
|||
|
||||
watch(
|
||||
() => route.params.id,
|
||||
async () => await getSales()
|
||||
() => tableRef.value.reload()
|
||||
);
|
||||
|
||||
const columns = computed(() => [
|
||||
|
@ -161,15 +161,6 @@ const onSalesFetched = (salesData) => {
|
|||
for (let sale of salesData) sale.amount = getSaleTotal(sale);
|
||||
};
|
||||
|
||||
const getSales = async () => {
|
||||
try {
|
||||
const { data } = await axios.get(`Tickets/${route.params.id}/getSales`);
|
||||
onSalesFetched(data);
|
||||
} catch (err) {
|
||||
console.error('Error fetching sales', err);
|
||||
}
|
||||
};
|
||||
|
||||
const getSaleTotal = (sale) => {
|
||||
if (sale.quantity == null || sale.price == null) return null;
|
||||
|
||||
|
@ -181,7 +172,7 @@ const getSaleTotal = (sale) => {
|
|||
|
||||
const resetChanges = async () => {
|
||||
arrayData.fetch({ append: false });
|
||||
getSales();
|
||||
tableRef.value.reload();
|
||||
};
|
||||
|
||||
const updateQuantity = async (sale) => {
|
||||
|
@ -434,7 +425,6 @@ const setTransferParams = async () => {
|
|||
onMounted(async () => {
|
||||
stateStore.rightDrawer = true;
|
||||
getConfig();
|
||||
getSales();
|
||||
getItems();
|
||||
});
|
||||
|
||||
|
@ -623,6 +613,7 @@ watch(
|
|||
:column-search="false"
|
||||
:disable-option="{ card: true }"
|
||||
auto-load
|
||||
@on-fetch="onSalesFetched"
|
||||
:create="{
|
||||
onDataSaved: handleOnDataSave,
|
||||
}"
|
||||
|
|
Loading…
Reference in New Issue