#49 feat: servicios API CRUD de organizations, suppliers, countries, departments, municipalities y getProduct
This commit is contained in:
@@ -15,6 +15,90 @@ class Api {
|
||||
return this.apiImplementation.updateProduct(productId, data);
|
||||
}
|
||||
|
||||
getProduct(productId) {
|
||||
return this.apiImplementation.getProduct(productId);
|
||||
}
|
||||
|
||||
getOrganizations() {
|
||||
return this.apiImplementation.getOrganizations();
|
||||
}
|
||||
|
||||
createOrganization(data) {
|
||||
return this.apiImplementation.createOrganization(data);
|
||||
}
|
||||
|
||||
updateOrganization(id, data) {
|
||||
return this.apiImplementation.updateOrganization(id, data);
|
||||
}
|
||||
|
||||
deleteOrganization(id) {
|
||||
return this.apiImplementation.deleteOrganization(id);
|
||||
}
|
||||
|
||||
getSuppliers() {
|
||||
return this.apiImplementation.getSuppliers();
|
||||
}
|
||||
|
||||
createSupplier(data) {
|
||||
return this.apiImplementation.createSupplier(data);
|
||||
}
|
||||
|
||||
updateSupplier(id, data) {
|
||||
return this.apiImplementation.updateSupplier(id, data);
|
||||
}
|
||||
|
||||
deleteSupplier(id) {
|
||||
return this.apiImplementation.deleteSupplier(id);
|
||||
}
|
||||
|
||||
getCountries() {
|
||||
return this.apiImplementation.getCountries();
|
||||
}
|
||||
|
||||
createCountry(data) {
|
||||
return this.apiImplementation.createCountry(data);
|
||||
}
|
||||
|
||||
updateCountry(id, data) {
|
||||
return this.apiImplementation.updateCountry(id, data);
|
||||
}
|
||||
|
||||
deleteCountry(id) {
|
||||
return this.apiImplementation.deleteCountry(id);
|
||||
}
|
||||
|
||||
getDepartments() {
|
||||
return this.apiImplementation.getDepartments();
|
||||
}
|
||||
|
||||
createDepartment(data) {
|
||||
return this.apiImplementation.createDepartment(data);
|
||||
}
|
||||
|
||||
updateDepartment(id, data) {
|
||||
return this.apiImplementation.updateDepartment(id, data);
|
||||
}
|
||||
|
||||
deleteDepartment(id) {
|
||||
return this.apiImplementation.deleteDepartment(id);
|
||||
}
|
||||
|
||||
getMunicipalities() {
|
||||
return this.apiImplementation.getMunicipalities();
|
||||
}
|
||||
|
||||
createMunicipality(data) {
|
||||
return this.apiImplementation.createMunicipality(data);
|
||||
}
|
||||
|
||||
updateMunicipality(id, data) {
|
||||
return this.apiImplementation.updateMunicipality(id, data);
|
||||
}
|
||||
|
||||
deleteMunicipality(id) {
|
||||
return this.apiImplementation.deleteMunicipality(id);
|
||||
}
|
||||
|
||||
getPaymentMethods() {
|
||||
return this.apiImplementation.getPaymentMethods();
|
||||
}
|
||||
|
||||
@@ -18,6 +18,10 @@ class DjangoApi {
|
||||
return http.patch(url, payload).then((r) => r.data);
|
||||
}
|
||||
|
||||
deleteRequest(url) {
|
||||
return http.delete(url).then((r) => r.data);
|
||||
}
|
||||
|
||||
getCustomers() {
|
||||
const url = this.base + "/don_confiao/api/customers/";
|
||||
return this.getRequest(url);
|
||||
@@ -39,6 +43,111 @@ class DjangoApi {
|
||||
return this.patchRequest(url, data);
|
||||
}
|
||||
|
||||
getProduct(productId) {
|
||||
const url = this.base + `/don_confiao/api/products/${productId}/`;
|
||||
return this.getRequest(url);
|
||||
}
|
||||
|
||||
getOrganizations() {
|
||||
const url = this.base + "/don_confiao/api/organizations/";
|
||||
return this.getRequest(url);
|
||||
}
|
||||
|
||||
createOrganization(data) {
|
||||
const url = this.base + "/don_confiao/api/organizations/";
|
||||
return this.postRequest(url, data);
|
||||
}
|
||||
|
||||
updateOrganization(id, data) {
|
||||
const url = this.base + `/don_confiao/api/organizations/${id}/`;
|
||||
return this.patchRequest(url, data);
|
||||
}
|
||||
|
||||
deleteOrganization(id) {
|
||||
const url = this.base + `/don_confiao/api/organizations/${id}/`;
|
||||
return this.deleteRequest(url);
|
||||
}
|
||||
|
||||
getSuppliers() {
|
||||
const url = this.base + "/don_confiao/api/suppliers/";
|
||||
return this.getRequest(url);
|
||||
}
|
||||
|
||||
createSupplier(data) {
|
||||
const url = this.base + "/don_confiao/api/suppliers/";
|
||||
return this.postRequest(url, data);
|
||||
}
|
||||
|
||||
updateSupplier(id, data) {
|
||||
const url = this.base + `/don_confiao/api/suppliers/${id}/`;
|
||||
return this.patchRequest(url, data);
|
||||
}
|
||||
|
||||
deleteSupplier(id) {
|
||||
const url = this.base + `/don_confiao/api/suppliers/${id}/`;
|
||||
return this.deleteRequest(url);
|
||||
}
|
||||
|
||||
getCountries() {
|
||||
const url = this.base + "/don_confiao/api/countries/";
|
||||
return this.getRequest(url);
|
||||
}
|
||||
|
||||
createCountry(data) {
|
||||
const url = this.base + "/don_confiao/api/countries/";
|
||||
return this.postRequest(url, data);
|
||||
}
|
||||
|
||||
updateCountry(id, data) {
|
||||
const url = this.base + `/don_confiao/api/countries/${id}/`;
|
||||
return this.patchRequest(url, data);
|
||||
}
|
||||
|
||||
deleteCountry(id) {
|
||||
const url = this.base + `/don_confiao/api/countries/${id}/`;
|
||||
return this.deleteRequest(url);
|
||||
}
|
||||
|
||||
getDepartments() {
|
||||
const url = this.base + "/don_confiao/api/departments/";
|
||||
return this.getRequest(url);
|
||||
}
|
||||
|
||||
createDepartment(data) {
|
||||
const url = this.base + "/don_confiao/api/departments/";
|
||||
return this.postRequest(url, data);
|
||||
}
|
||||
|
||||
updateDepartment(id, data) {
|
||||
const url = this.base + `/don_confiao/api/departments/${id}/`;
|
||||
return this.patchRequest(url, data);
|
||||
}
|
||||
|
||||
deleteDepartment(id) {
|
||||
const url = this.base + `/don_confiao/api/departments/${id}/`;
|
||||
return this.deleteRequest(url);
|
||||
}
|
||||
|
||||
getMunicipalities() {
|
||||
const url = this.base + "/don_confiao/api/municipalities/";
|
||||
return this.getRequest(url);
|
||||
}
|
||||
|
||||
createMunicipality(data) {
|
||||
const url = this.base + "/don_confiao/api/municipalities/";
|
||||
return this.postRequest(url, data);
|
||||
}
|
||||
|
||||
updateMunicipality(id, data) {
|
||||
const url = this.base + `/don_confiao/api/municipalities/${id}/`;
|
||||
return this.patchRequest(url, data);
|
||||
}
|
||||
|
||||
deleteMunicipality(id) {
|
||||
const url = this.base + `/don_confiao/api/municipalities/${id}/`;
|
||||
return this.deleteRequest(url);
|
||||
}
|
||||
|
||||
getPaymentMethods() {
|
||||
const url =
|
||||
this.base + "/don_confiao/payment_methods/all/select_format";
|
||||
|
||||
Reference in New Issue
Block a user