async def save_space(space: Space, current_user: User = Depends(deps.get_current_user)): if space.spaceId is None or check_fake_id(space.spaceId): # sync space group id result = create_space(space) sync_space_to_user_group(result) return result else: sync_space_to_user_group(space) return update_space_by_id(space.spaceId, space)
async def update_space(space_id, space: Space = Body(...), current_user: User = Depends(deps.get_current_user)): sync_space_to_user_group(space) return update_space_by_id(space_id, space)