Generado repositorio para consultar la api #86 #87

Merged
mono merged 7 commits from generate_repository_code_#86 into main 2025-01-11 16:05:32 -05:00
3 changed files with 21 additions and 12 deletions
Showing only changes of commit d9f6be8b54 - Show all commits

View File

@ -83,6 +83,7 @@
</v-container>
</template>
<script>
import { inject } from 'vue';
import CurrencyText from './CurrencyText.vue';
import SummaryPurchaseModal from './SummaryPurchaseModal.vue';
@ -96,6 +97,7 @@
},
data () {
return {
api: inject('api'),
valid: null,
selectedPurchaseId: null,
selectedTab: 'CASH',
@ -171,9 +173,7 @@
this.$refs.summaryModal.dialog = true;
},
fetchPurchases() {
const endpoint = '/don_confiao/purchases/for_reconciliation';
fetch(endpoint)
.then(response => response.json())
this.api.getPurchasesForReconciliation()
.then(data => {
this.summary.purchases = data;
this.reconciliation.cash_purchases = this.idsBymethod('CASH');

View File

@ -19,6 +19,10 @@ class Api {
return this.apiImplementation.getSummaryPurchase(purchaseId);
}
getPurchasesForReconciliation() {
return this.apiImplementation.getPurchasesForReconciliation();
}
createPurchase(purchase) {
return this.apiImplementation.createPurchase(purchase);
}

View File

@ -19,6 +19,11 @@ class DjangoApi {
return this.getRequest(url);
}
getPurchasesForReconciliation() {
const url = '/don_confiao/purchases/for_reconciliation';
return this.getRequest(url);
}
createPurchase(purchase) {
return new Promise((resolve, reject) => {
console.log('compra a enviar:', purchase);