Add editable article prices with gross input and staffel tiers.
Wire PUT /prices, de-DE formatting, tax/staffel pills, and keep the category list cache in sync after photo/price updates.
This commit is contained in:
@@ -223,6 +223,15 @@ const categorySlice = createSlice({
|
||||
state.articlesTotal = state.articles.length;
|
||||
state.rootArticles = state.rootArticles.filter((row) => row.sku !== sku);
|
||||
},
|
||||
/** Keep category tile list in sync with article detail (e.g. after photo upload). */
|
||||
patchArticleInLists(state, action) {
|
||||
const { sku, ...fields } = action.payload;
|
||||
if (sku == null) return;
|
||||
const patchList = (list) =>
|
||||
list.map((row) => (row.sku === sku ? { ...row, ...fields } : row));
|
||||
state.articles = patchList(state.articles);
|
||||
state.rootArticles = patchList(state.rootArticles);
|
||||
},
|
||||
},
|
||||
extraReducers: (builder) => {
|
||||
builder
|
||||
@@ -305,6 +314,7 @@ export const {
|
||||
navigateBack,
|
||||
resetCategoryState,
|
||||
removeArticleBySku,
|
||||
patchArticleInLists,
|
||||
} = categorySlice.actions;
|
||||
|
||||
export const selectCategoryMap = (state) => state.category.categories;
|
||||
|
||||
Reference in New Issue
Block a user