mejoras en el modelo de clarificacion de productos
This commit is contained in:
@@ -76,6 +76,30 @@ export const api = {
|
||||
return fetch("/products/sync", { method: "POST" }).then(r => r.json());
|
||||
},
|
||||
|
||||
async updateProductUnit(wooProductId, { sell_unit }) {
|
||||
return fetch(`/products/${encodeURIComponent(wooProductId)}/unit`, {
|
||||
method: "PATCH",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ sell_unit }),
|
||||
}).then(r => r.json());
|
||||
},
|
||||
|
||||
async updateProduct(wooProductId, { sell_unit, categories }) {
|
||||
return fetch(`/products/${encodeURIComponent(wooProductId)}`, {
|
||||
method: "PATCH",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ sell_unit, categories }),
|
||||
}).then(r => r.json());
|
||||
},
|
||||
|
||||
async updateProductsUnit(wooProductIds, { sell_unit }) {
|
||||
return fetch(`/products/bulk/unit`, {
|
||||
method: "PATCH",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ woo_product_ids: wooProductIds, sell_unit }),
|
||||
}).then(r => r.json());
|
||||
},
|
||||
|
||||
// Aliases CRUD
|
||||
async aliases({ q = "", woo_product_id = null, limit = 200 } = {}) {
|
||||
const u = new URL("/aliases", location.origin);
|
||||
|
||||
Reference in New Issue
Block a user