async def save_user_group(user_group: UserGroup, current_user: User = Depends(deps.get_current_user)): if check_fake_id(user_group.userGroupId): user_group.userGroupId = None if user_group.userGroupId is None or check_fake_id(user_group.userGroupId): return create_user_group_storage(user_group) else: return update_user_group_storage(user_group)
async def save_user_group(user_group: UserGroup, current_user: User = Depends(deps.get_current_user)): if check_fake_id(user_group.userGroupId): user_group.userGroupId = None if user_group.userGroupId is None or check_fake_id(user_group.userGroupId): result = create_user_group_storage(user_group) sync_user_group_to_space(result) return result else: sync_user_group_to_space(user_group) return update_user_group_storage(user_group)