console category

This commit is contained in:
2026-09-07 17:50:57 +05:30
parent 954dfb8c00
commit 56f183f6f6
4 changed files with 266 additions and 7 deletions

View File

@@ -152,6 +152,15 @@ export const productsApi = {
resolveCategories: (tenantid: number, names: string[]) =>
api.post<Record<string, number>>(`${WEB}/products/resolvecategories`, { tenantid, names }),
/**
* Re-files products into different categories, in bulk.
*
* Scoped by tenant on the server as well as here — a productid is global, so
* a wrong id in the list would otherwise move another merchant's product.
*/
recategorise: (tenantid: number, updates: { productid: number; categoryid: number }[]) =>
api.put<{ moved: number }>(`${WEB}/products/recategorise`, { tenantid, updates }),
/** Unlinks from the store. The product row and its order history survive. */
removeFromStore: (body: { tenantid: number; locationid: number; productid: number }) =>
api.del<unknown>(`${WEB}/products/deleteproductlocation`, body),