#84 refactor(front): moved to api purchases_for_reconciliation to.
This commit is contained in:
parent
34259921d9
commit
d9f6be8b54
@ -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');
|
||||
|
@ -19,6 +19,10 @@ class Api {
|
||||
return this.apiImplementation.getSummaryPurchase(purchaseId);
|
||||
}
|
||||
|
||||
getPurchasesForReconciliation() {
|
||||
return this.apiImplementation.getPurchasesForReconciliation();
|
||||
}
|
||||
|
||||
createPurchase(purchase) {
|
||||
return this.apiImplementation.createPurchase(purchase);
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user