dashboard
This commit is contained in:
@@ -185,13 +185,23 @@ export const api = {
|
||||
return fetch("/products/sync-from-woo", { method: "POST" }).then(r => r.json());
|
||||
},
|
||||
|
||||
// --- Testing ---
|
||||
async listRecentOrders({ limit = 20 } = {}) {
|
||||
const u = new URL("/test/orders", location.origin);
|
||||
// --- Orders & Stats ---
|
||||
async listOrders({ page = 1, limit = 50 } = {}) {
|
||||
const u = new URL("/api/orders", location.origin);
|
||||
u.searchParams.set("page", String(page));
|
||||
u.searchParams.set("limit", String(limit));
|
||||
return fetch(u).then(r => r.json());
|
||||
},
|
||||
|
||||
async getOrderStats() {
|
||||
return fetch("/api/stats/orders").then(r => r.json());
|
||||
},
|
||||
|
||||
// Alias para compatibilidad
|
||||
async listRecentOrders({ limit = 20 } = {}) {
|
||||
return this.listOrders({ page: 1, limit });
|
||||
},
|
||||
|
||||
async getProductsWithStock() {
|
||||
return fetch("/test/products-with-stock").then(r => r.json());
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user