chore: delete implementation in product collection

This commit is contained in:
Rodolfo Ruiz
2025-09-06 20:34:46 -06:00
parent efdb48919f
commit b3209a4019
3 changed files with 46 additions and 3 deletions

View File

@@ -52,4 +52,15 @@ export default class ProductsApi {
if (!res.ok) throw new Error(`Delete error ${res.status}: ${await res.text()}`);
return res.json();
}
async changeStatusVariant(payload) {
// If your API is change status, reuse updateVariant.
const res = await fetch(`${this.baseUrl}/ChangeStatus`, {
method: 'PATCH',
headers: this.headers(),
body: JSON.stringify(payload),
});
if (!res.ok) throw new Error(`ChangeStatus error ${res.status}: ${await res.text()}`);
return res.json();
}
}