Skip to content

Commit

Permalink
fix: fix param type error when create group
Browse files Browse the repository at this point in the history
  • Loading branch information
gene9831 committed Jan 2, 2025
1 parent 9027902 commit 7eeeaa2
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions packages/plugins/block/src/js/blockSetting.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -727,15 +727,25 @@ export const getBlockById = async (id) => {

export const createOrUpdateCategory = async ({ categoryId, ...params }, isEdit) => {
const appId = getAppId()
params.app = Number(appId)
const replaceCategoryWithGroup = useBlock().shouldReplaceCategoryWithGroup()
let requestFunc = replaceCategoryWithGroup ? updateGroup : updateCategory
let requestFunc

if (replaceCategoryWithGroup) {
params.app = appId
requestFunc = updateGroup
} else {
params.app = Number(appId)
requestFunc = updateCategory
}

if (!isEdit) {
if (!replaceCategoryWithGroup) {
// 替换成创建接口
if (replaceCategoryWithGroup) {
requestFunc = createGroup
} else {
requestFunc = createCategory
params.category_id = categoryId
}
requestFunc = replaceCategoryWithGroup ? createGroup : createCategory
}

const res = await requestFunc(params)
Expand Down

0 comments on commit 7eeeaa2

Please sign in to comment.