feat: agregar página de gestión de productos activos/inactivos

- Agregar ProductsManagement.vue con tabla de productos
- Filtros: Activos, Inactivos, Todos
- Búsqueda por nombre en tiempo real
- Acciones por lote: activar/desactivar múltiples productos
- Botones condicionales según filtro activo
- Agregar ruta protegida /admin/products
- Actualizar API con métodos getProducts(active) y updateProduct()
- Agregar método patchRequest en django-api
- Agregar menú 'Gestión de Productos' en NavBar
This commit is contained in:
2026-05-29 00:53:38 -05:00
parent cb79ad6d45
commit 6aecbd37d2
6 changed files with 297 additions and 4 deletions

View File

@@ -14,16 +14,31 @@ class DjangoApi {
return http.post(url, payload).then((r) => r.data);
}
patchRequest(url, payload) {
return http.patch(url, payload).then((r) => r.data);
}
getCustomers() {
const url = this.base + "/don_confiao/api/customers/";
return this.getRequest(url);
}
getProducts() {
const url = this.base + "/don_confiao/api/products/";
getProducts(active = 'all') {
let url = this.base + "/don_confiao/api/products/";
// Agregar query parameter según filtro
if (active !== 'all') {
url += `?active=${active}`;
}
return this.getRequest(url);
}
updateProduct(productId, data) {
const url = this.base + `/don_confiao/api/products/${productId}/`;
return this.patchRequest(url, data);
}
getPaymentMethods() {
const url =
this.base + "/don_confiao/payment_methods/all/select_format";