chore: format category mock toggle updates

This commit is contained in:
2026-02-20 18:47:03 +08:00
parent 6145eec825
commit b2a3a1b75f
2 changed files with 7 additions and 4 deletions

View File

@@ -3,4 +3,6 @@
import './product';
import './product-extensions';
console.warn('[Mock] 已启用非门店/非分类管理 Mock 数据(分类管理强制走真实 API');
console.warn(
'[Mock] 已启用非门店/非分类管理 Mock 数据(分类管理强制走真实 API',
);

View File

@@ -643,9 +643,10 @@ if (ENABLE_PRODUCT_CATEGORY_MOCK) {
}
const currentSortMax =
state.categories.reduce((max, item) => Math.max(max, item.sort), 0) +
1;
const existingIndex = state.categories.findIndex((item) => item.id === id);
state.categories.reduce((max, item) => Math.max(max, item.sort), 0) + 1;
const existingIndex = state.categories.findIndex(
(item) => item.id === id,
);
const next =
existingIndex === -1