dev: fix django connection.
This commit is contained in:
parent
ccc233f008
commit
27cbeca6cb
4
.gitignore
vendored
4
.gitignore
vendored
@ -20,3 +20,7 @@ pnpm-debug.log*
|
|||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
/.browserslistrc
|
||||||
|
/.editorconfig
|
||||||
|
/.eslintrc-auto-import.json
|
||||||
|
/.eslintrc.js
|
||||||
|
@ -1,56 +1,60 @@
|
|||||||
class DjangoApi {
|
class DjangoApi {
|
||||||
|
constructor() {
|
||||||
|
this.base = 'http://localhost:7000';
|
||||||
|
}
|
||||||
|
|
||||||
getCustomers() {
|
getCustomers() {
|
||||||
const url = '/don_confiao/api/customers/';
|
const url = this.base + '/don_confiao/api/customers/';
|
||||||
return this.getRequest(url);
|
return this.getRequest(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
getProducts() {
|
getProducts() {
|
||||||
const url = '/don_confiao/api/products/';
|
const url = this.base + '/don_confiao/api/products/';
|
||||||
return this.getRequest(url);
|
return this.getRequest(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
getPaymentMethods() {
|
getPaymentMethods() {
|
||||||
const url = '/don_confiao/payment_methods/all/select_format';
|
const url = this.base + '/don_confiao/payment_methods/all/select_format';
|
||||||
return this.getRequest(url);
|
return this.getRequest(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSummaryPurchase(purchaseId) {
|
getSummaryPurchase(purchaseId) {
|
||||||
const url = `/don_confiao/resumen_compra_json/${purchaseId}`;
|
const url = this.base + `/don_confiao/resumen_compra_json/${purchaseId}`;
|
||||||
return this.getRequest(url);
|
return this.getRequest(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
getPurchasesForReconciliation() {
|
getPurchasesForReconciliation() {
|
||||||
const url = '/don_confiao/purchases/for_reconciliation';
|
const url = this.base + '/don_confiao/purchases/for_reconciliation';
|
||||||
return this.getRequest(url);
|
return this.getRequest(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
getListReconcliations(page, itemsPerPage) {
|
getListReconcliations(page, itemsPerPage) {
|
||||||
const url = `/don_confiao/api/reconciliate_jar/?page=${page}&page_size=${itemsPerPage}`;
|
const url = this.base + `/don_confiao/api/reconciliate_jar/?page=${page}&page_size=${itemsPerPage}`;
|
||||||
return this.getRequest(url);
|
return this.getRequest(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
getReconciliation(reconciliationId) {
|
getReconciliation(reconciliationId) {
|
||||||
const url = `/don_confiao/api/reconciliate_jar/${reconciliationId}/`;
|
const url = this.base + `/don_confiao/api/reconciliate_jar/${reconciliationId}/`;
|
||||||
return this.getRequest(url);
|
return this.getRequest(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
isValidAdminCode(code) {
|
isValidAdminCode(code) {
|
||||||
const url = `/don_confiao/api/admin_code/validate/${code}`
|
const url = this.base + `/don_confiao/api/admin_code/validate/${code}`
|
||||||
return this.getRequest(url)
|
return this.getRequest(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
createPurchase(purchase) {
|
createPurchase(purchase) {
|
||||||
const url = '/don_confiao/api/sales/';
|
const url = this.base + '/don_confiao/api/sales/';
|
||||||
return this.postRequest(url, purchase);
|
return this.postRequest(url, purchase);
|
||||||
}
|
}
|
||||||
|
|
||||||
createReconciliationJar(reconciliation) {
|
createReconciliationJar(reconciliation) {
|
||||||
const url = '/don_confiao/reconciliate_jar';
|
const url = this.base + '/don_confiao/reconciliate_jar';
|
||||||
return this.postRequest(url, reconciliation);
|
return this.postRequest(url, reconciliation);
|
||||||
}
|
}
|
||||||
|
|
||||||
createCustomer(customer) {
|
createCustomer(customer) {
|
||||||
const url = '/don_confiao/api/customers/';
|
const url = this.base + '/don_confiao/api/customers/';
|
||||||
return this.postRequest(url, customer);
|
return this.postRequest(url, customer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,6 @@ export default defineConfig({
|
|||||||
port: 3000,
|
port: 3000,
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
outDir: '../../static/frontend/',
|
outDir: 'dist/',
|
||||||
},
|
},
|
||||||
base: '/frontend/',
|
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user