pricing update
This commit is contained in:
@@ -47,6 +47,7 @@ import {
|
||||
getProductsCount,
|
||||
getProductStocks,
|
||||
getProductLocations,
|
||||
createProductLocations,
|
||||
getMasterCatalog,
|
||||
getProductCategories,
|
||||
getProductSubcategories,
|
||||
@@ -1024,6 +1025,25 @@ export function useFiestaCreateProductLocation() {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Publish/reprice one product across many outlets in a single request. Used by
|
||||
* the admin catalogue, where a price the admin sets is meant to apply to every
|
||||
* store under the tenant — not just whichever outlet happened to load first.
|
||||
*/
|
||||
export function useFiestaCreateProductLocations() {
|
||||
const qc = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: (inputs: Array<{ tenantid: number; locationid: number; productid: number; price?: number; status?: string }>) =>
|
||||
createProductLocations(inputs),
|
||||
onSuccess: () => {
|
||||
qc.invalidateQueries({ queryKey: ['catalogue', 'imported'] });
|
||||
qc.invalidateQueries({ queryKey: ['fiesta', 'productLocations'] });
|
||||
qc.invalidateQueries({ queryKey: ['fiesta', 'productStocks'] });
|
||||
qc.invalidateQueries({ queryKey: ['fiesta', 'stockStatement'] });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function useFiestaDeleteProductLocation() {
|
||||
const qc = useQueryClient();
|
||||
return useMutation({
|
||||
|
||||
Reference in New Issue
Block a user