File tree Expand file tree Collapse file tree
packages/toolbars/upload/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1011,6 +1011,18 @@ export default {
10111011 const existingCategories = Array .isArray (existing .categories )
10121012 ? existing .categories .map ((item : any ) => item ?.id || item ).filter (Boolean )
10131013 : []
1014+ let relationParams: Record <string , any >
1015+
1016+ if (groupId ) {
1017+ relationParams = { groups: [groupId ] }
1018+ } else if (existingGroups .length ) {
1019+ relationParams = { groups: existingGroups }
1020+ } else {
1021+ relationParams = {
1022+ categories: existingCategories .length ? existingCategories : blockParams .categories || []
1023+ }
1024+ }
1025+
10141026 const updateParams = {
10151027 name_cn: blockParams .name_cn ,
10161028 label: blockParams .label ,
@@ -1020,11 +1032,7 @@ export default {
10201032 public_scope_tenants: existing .public_scope_tenants || [],
10211033 tags: existing .tags || [],
10221034 description: existing .description || ' ' ,
1023- ... (groupId
1024- ? { groups: [groupId ] }
1025- : existingGroups .length
1026- ? { groups: existingGroups }
1027- : { categories: existingCategories .length ? existingCategories : blockParams .categories || [] })
1035+ ... relationParams
10281036 }
10291037
10301038 blockData = await updateBlock (existing .id , updateParams , appId )
You can’t perform that action at this time.
0 commit comments