dev: fix django connection.
This commit is contained in:
		| @@ -1,56 +1,60 @@ | ||||
| class DjangoApi { | ||||
|   constructor() { | ||||
|     this.base = 'http://localhost:7000'; | ||||
|   } | ||||
|  | ||||
|   getCustomers() { | ||||
|     const url = '/don_confiao/api/customers/'; | ||||
|     const url = this.base + '/don_confiao/api/customers/'; | ||||
|     return this.getRequest(url); | ||||
|   } | ||||
|  | ||||
|   getProducts() { | ||||
|     const url = '/don_confiao/api/products/'; | ||||
|     const url = this.base + '/don_confiao/api/products/'; | ||||
|     return this.getRequest(url); | ||||
|   } | ||||
|  | ||||
|   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); | ||||
|   } | ||||
|  | ||||
|   getSummaryPurchase(purchaseId) { | ||||
|     const url = `/don_confiao/resumen_compra_json/${purchaseId}`; | ||||
|     const url = this.base + `/don_confiao/resumen_compra_json/${purchaseId}`; | ||||
|     return this.getRequest(url); | ||||
|   } | ||||
|  | ||||
|   getPurchasesForReconciliation() { | ||||
|     const url = '/don_confiao/purchases/for_reconciliation'; | ||||
|     const url = this.base + '/don_confiao/purchases/for_reconciliation'; | ||||
|     return this.getRequest(url); | ||||
|   } | ||||
|  | ||||
|   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); | ||||
|   } | ||||
|  | ||||
|   getReconciliation(reconciliationId) { | ||||
|     const url = `/don_confiao/api/reconciliate_jar/${reconciliationId}/`; | ||||
|     const url = this.base + `/don_confiao/api/reconciliate_jar/${reconciliationId}/`; | ||||
|     return this.getRequest(url); | ||||
|   } | ||||
|  | ||||
|   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) | ||||
|     } | ||||
|  | ||||
|   createPurchase(purchase) { | ||||
|     const url = '/don_confiao/api/sales/'; | ||||
|     const url = this.base + '/don_confiao/api/sales/'; | ||||
|     return this.postRequest(url, purchase); | ||||
|   } | ||||
|  | ||||
|   createReconciliationJar(reconciliation) { | ||||
|     const url = '/don_confiao/reconciliate_jar'; | ||||
|     const url = this.base + '/don_confiao/reconciliate_jar'; | ||||
|     return this.postRequest(url, reconciliation); | ||||
|   } | ||||
|  | ||||
|   createCustomer(customer) { | ||||
|     const url = '/don_confiao/api/customers/'; | ||||
|     const url = this.base + '/don_confiao/api/customers/'; | ||||
|     return this.postRequest(url, customer); | ||||
|   } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user